-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
- name: Setup Moonbit | ||
uses: hustcer/[email protected] | ||
|
||
- name: moon check | ||
run: moon check | ||
# - name: moon check | ||
# run: moon check | ||
|
||
# - name: moon info | ||
# run: | | ||
|
@@ -25,7 +25,6 @@ jobs: | |
|
||
- name: moon test | ||
run: | | ||
moon test | ||
moon test --target js | ||
# - name: moon bundle | ||
|
@@ -34,7 +33,7 @@ jobs: | |
# - name: check core size | ||
# run: ls -alh `find ./target/bundle -name *.core` | ||
|
||
- name: format diff | ||
run: | | ||
moon fmt | ||
git diff | ||
# - name: format diff | ||
# run: | | ||
# moon fmt | ||
# git diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
test "parser" { | ||
println(@lib.parse!("def a")) | ||
assert_eq!( | ||
@lib.parse!("def a"), | ||
[@lib.Cirru::Leaf("def"), @lib.Cirru::Leaf("a")], | ||
[@lib.Cirru::List([@lib.Cirru::Leaf("def"), @lib.Cirru::Leaf("a")])], | ||
) | ||
} | ||
|
||
test "existed demos" { | ||
let demos = [ | ||
"comma", "demo", "folding", "html", "indent-twice", "indent", "let", "line", | ||
"list-match", "paren-indent", "paren-indent2", "parentheses", "quote", "spaces", | ||
"unfolding", | ||
] | ||
for demo in demos { | ||
let demo_file = fsReadSync("./test/cirru/\{demo}.cirru") | ||
let json_file = fsReadSync("./test/data/\{demo}.json") | ||
let tree = @lib.parse?(demo_file).unwrap().to_json().stringify() | ||
let defined = @json.parse?(json_file).unwrap().stringify() | ||
assert_eq!(tree, defined) | ||
} | ||
} | ||
|
||
pub extern "js" fn fsReadSync(path : String) -> String = | ||
#|(path) => { | ||
#| const fs = require("node:fs"); | ||
#| return fs.readFileSync(path, { encoding: "utf8" }); | ||
#|} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters