aboutsummaryrefslogtreecommitdiff
path: root/test/test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.js')
-rw-r--r--test/test.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test.js b/test/test.js
new file mode 100644
index 0000000..34cbdf0
--- /dev/null
+++ b/test/test.js
@@ -0,0 +1,17 @@
+import {tabloidLanguage} from "../dist/index.js"
+import {fileTests} from "@lezer/generator/dist/test"
+
+import * as fs from "fs"
+import * as path from "path"
+import { fileURLToPath } from 'url';
+let caseDir = path.dirname(fileURLToPath(import.meta.url))
+
+for (let file of fs.readdirSync(caseDir)) {
+ if (!/\.txt$/.test(file)) continue
+
+ let name = /^[^\.]*/.exec(file)[0]
+ describe(name, () => {
+ for (let {name, run} of fileTests(fs.readFileSync(path.join(caseDir, file), "utf8"), file))
+ it(name, () => run(tabloidLanguage.parser))
+ })
+}