deno.land / x / froebel@v0.23.2 / surround.test.ts

surround.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import surround from "./surround.ts";import { assertEquals, assertThrows } from "testing/asserts.ts";
Deno.test("surround", () => { assertEquals(surround("foo", "()"), "(foo)"); assertEquals(surround("foo", "([])"), "([foo])"); assertEquals(surround("foo", ""), "foo"); assertThrows(() => surround("foo", "abc"));
const _0: "[({foo})]" = surround("foo", "[({})]"); // @ts-expect-error const _1: "[{(foo)}]" = surround("foo", "[({})]"); const _2: "foo" = surround("foo", "");});
froebel

Version Info

Tagged at
a year ago