Skip to content

Commit

Permalink
Merge pull request #33 from Cirru/list-match
Browse files Browse the repository at this point in the history
include list-match demo in tests data
  • Loading branch information
NoEgAm authored Aug 7, 2023
2 parents 89c8d82 + 6ca38db commit 53ff39b
Show file tree
Hide file tree
Showing 5 changed files with 1,279 additions and 1,269 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@emotion/css": "^11.10.0",
"@types/jest": "^28.1.7",
"@types/node": "^18.7.11",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"dayjs": "^1.11.5",
"jest": "^28.1.3",
"prettier": "^2.7.1",
"@emotion/css": "^11.11.2",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.6",
"@types/react": "^18.2.18",
"@types/react-dom": "^18.2.7",
"dayjs": "^1.11.9",
"jest": "^29.6.2",
"prettier": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-jest": "^28.0.8",
"typescript": "^4.7.4",
"typescript-styled-plugin": "^0.18.2",
"vite": "^3.0.9"
"ts-jest": "^29.1.1",
"typescript": "^5.1.6",
"typescript-styled-plugin": "^0.18.3",
"vite": "^4.4.8"
},
"dependencies": {}
}
6 changes: 6 additions & 0 deletions src/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ test("unfolding", () => {
expect(parse(code)).toEqual(data);
});

test("list-match", () => {
let code = fs.readFileSync(path.join(__dirname, "../test/cirru/list-match.cirru"), "utf8");
let data = require(path.join(__dirname, "../test/ast/list-match.json"));
expect(parse(code)).toEqual(data);
});

test("with escaping", () => {
let code = `"\'a"`;
let data = [["'a"]];
Expand Down
12 changes: 12 additions & 0 deletions test/ast/list-match.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
[
"list-match",
["a", "b"],
[[], ["c", "d"]],
[
["e", "f"],
["g", "h"],
["i", "j", "k"]
]
]
]
6 changes: 6 additions & 0 deletions test/cirru/list-match.cirru
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

list-match (a b)
() $ c d
(e f)
g h
i j k
Loading

0 comments on commit 53ff39b

Please sign in to comment.