deno.land / std@0.224.0 / expect / _string_matching_test.ts

_string_matching_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { expect } from "./expect.ts";
Deno.test("expect.stringMatching() with strings", () => { expect("deno_std").toEqual(expect.stringMatching("std")); expect("function").toEqual(expect.stringMatching("func"));
expect("Hello, World").not.toEqual(expect.stringMatching("hello")); expect("foobar").not.toEqual(expect.stringMatching("bazz"));});
Deno.test("expect.stringMatching() with RegExp", () => { expect("deno_std").toEqual(expect.stringMatching(/std/)); expect("0123456789").toEqual(expect.stringMatching(/\d+/));
expect("\e").not.toEqual(expect.stringMatching(/\s/)); expect("queue").not.toEqual(expect.stringMatching(/en/));});
std

Version Info

Tagged at
3 weeks ago