Skip to content

Commit

Permalink
testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin-Yeung committed Nov 14, 2024
1 parent 6ab62ea commit 5e116ad
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 101 deletions.
13 changes: 12 additions & 1 deletion src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ mod test {
}

#[test]
fn test_typed_set_algebra() {
fn test_typed_set_algebra_expr() {
let text = include_str!("../examples/set-algebra-typed.bnfgen");
let grammar = RawGrammar::parse(text).unwrap().to_checked().unwrap();
let gen = Generator { grammar };
Expand All @@ -131,4 +131,15 @@ mod test {
.join("\n");
insta::assert_snapshot!(out);
}

#[test]
fn test_typed_set_algebra() {
let text = include_str!("../examples/set-algebra-typed.bnfgen");
let grammar = RawGrammar::parse(text).unwrap().to_checked().unwrap();
let gen = Generator { grammar };
let mut seeded_rng = rand::rngs::StdRng::seed_from_u64(42);
let out = gen.generate("Program", &mut seeded_rng);
insta::assert_snapshot!(out);
}

}
Loading

0 comments on commit 5e116ad

Please sign in to comment.