docs(assert): update assertMatch example (#5294)

This commit is contained in:
Yoshiya Hinosawa 2024-07-04 15:30:27 +09:00 committed by GitHub
parent ed1ab2684a
commit 99764a7869
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -10,8 +10,8 @@ import { AssertionError } from "./assertion_error.ts";
* ```ts no-eval
* import { assertMatch } from "@std/assert";
*
* assertMatch("Raptor", RegExp(/Raptor/)); // Doesn't throw
* assertMatch("Denosaurus", RegExp(/Raptor/)); // Throws
* assertMatch("Raptor", /Raptor/); // Doesn't throw
* assertMatch("Denosaurus", /Raptor/); // Throws
* ```
*
* @param actual The actual value to be matched.

View File

@ -10,8 +10,8 @@ import { AssertionError } from "./assertion_error.ts";
* ```ts no-eval
* import { assertNotMatch } from "@std/assert";
*
* assertNotMatch("Denosaurus", RegExp(/Raptor/)); // Doesn't throw
* assertNotMatch("Raptor", RegExp(/Raptor/)); // Throws
* assertNotMatch("Denosaurus", /Raptor/); // Doesn't throw
* assertNotMatch("Raptor", /Raptor/); // Throws
* ```
*
* @param actual The actual value to match.