Mylloon
a790ddf377
All checks were successful
Publish latest version / build (push) Successful in 2m11s
Close #201 Tests run much faster and we don't need as much as libs Reviewed-on: #210 Co-authored-by: Mylloon <kennel.anri@tutanota.com> Co-committed-by: Mylloon <kennel.anri@tutanota.com>
29 lines
849 B
TypeScript
29 lines
849 B
TypeScript
import { RegexC, RegExpFlags } from "../../src/utils/regex";
|
|
|
|
import { describe, it } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
describe("Regex flags", () => {
|
|
it("One parameter", () => {
|
|
const regex = RegexC("", RegExpFlags.Global);
|
|
assert.strictEqual(regex.global, true);
|
|
});
|
|
|
|
it("All parameters", () => {
|
|
const regex = RegexC(
|
|
"",
|
|
RegExpFlags.Global |
|
|
RegExpFlags.MultiLine |
|
|
RegExpFlags.Insensitive |
|
|
RegExpFlags.Sticky |
|
|
RegExpFlags.Unicode |
|
|
RegExpFlags.SingleLine,
|
|
);
|
|
assert.strictEqual(regex.global, true);
|
|
assert.strictEqual(regex.multiline, true);
|
|
assert.strictEqual(regex.ignoreCase, true);
|
|
assert.strictEqual(regex.sticky, true);
|
|
assert.strictEqual(regex.unicode, true);
|
|
assert.strictEqual(regex.dotAll, true);
|
|
});
|
|
});
|