Debian Codegraph @

spec/issues/1683_re2_engine.spec.ts

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 import getAjvAllInstances from "../ajv_all_instances"
2 import {withStandalone} from "../ajv_standalone"
3 import {_} from "../../dist/compile/codegen/code"
4 import * as jsonSchemaTest from "json-schema-test"
5 import options from "../ajv_options"
6 import {afterError, afterEach} from "../after_test"
7 import chai from "../chai"
8 import re2 from "../../dist/runtime/re2"
9 import re2tests from "./re2"
10
11 const instances = getAjvAllInstances(options, {
12 $data: true,
13 formats: {allowedUnknown: true},
14 strictTypes: false,
15 strictTuples: false,
16 })
17
18 instances.forEach((ajv) => {
19 ajv.opts.code.source = true
20 ajv.opts.code.formats = _`{allowedUnknown: true}`
21 ajv.opts.code.regExp = re2
22 })
23
24 jsonSchemaTest(withStandalone(instances), {
25 description: "Test with re2 RegExp engine with " + instances.length + " ajv instances",
26 suites: {"regular expressions": re2tests},
27 assert: chai.assert,
28 afterError,
29 afterEach,
30 cwd: __dirname,
31 hideFolder: "extras/",
32 timeout: 90000,
33 })