Skip to content

Commit

Permalink
feat: more test case for first set
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin-Yeung committed Nov 22, 2023
1 parent 499d614 commit 895d238
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/utils/first/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,20 @@ mod test {

insta::assert_display_snapshot!(first.tabled());
}

#[test]
fn test_case_1() {
let grammar = r#"
<P> ::= <Q> 'id' <R>
<Q> ::= '∃' | '∀'
<R> ::= <E> '=' <E>
<E> ::= <T> <E'>
<E'> ::= '+' <T> <E'> | 'ε'
<T> ::= '(' <E> ')' | 'id'
"#
.parse()
.unwrap();
let first = First::new(&grammar);
insta::assert_display_snapshot!(first.tabled());
}
}

0 comments on commit 895d238

Please sign in to comment.