Skip to content

Commit

Permalink
[WIP] Add wasm test for new parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Feb 3, 2023
1 parent 32ac329 commit 145eefa
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion crates/parser2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ fxhash = "0.2.1"
lazy_static = "1.4.0"

[dev-dependencies]
fe-compiler-test-utils = { path = "../test-utils" }
fe-compiler-test-utils = { path = "../test-utils" }
dir-test = { git = "https://github.com/fe-lang/dir-test" }
wasm-bindgen-test = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
11 changes: 11 additions & 0 deletions crates/parser2/tests/syntax_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use fe_parser2::{

mod test_runner;
use test_runner::*;
use wasm_bindgen_test::wasm_bindgen_test;

fe_compiler_test_utils::build_debug_snap_tests! {
"parser2/test_files/syntax_node/structs",
Expand Down Expand Up @@ -87,3 +88,13 @@ fe_compiler_test_utils::build_debug_snap_tests!(
"parser2/test_files/syntax_node/items",
test_item_list
);

#[dir_test::dir_test(
#[wasm_bindgen_test]
dir: "$CARGO_MANIFEST_DIR/test_files/syntax_node",
glob: "**/*.fe"
postfix: "wasm"
)]
fn ident(fixture: dir_test::Fixture) {
assert!(fixture.content() == fixture.content());
}

0 comments on commit 145eefa

Please sign in to comment.