Skip to content

Commit

Permalink
feat: test cases for first
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin-Yeung committed Nov 17, 2023
1 parent a912429 commit 401dee9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ mod tests {
fn first() {
let grammar = grammar();
let mut first = First::new(&grammar);
dbg!(first.first());
first.first().iter().for_each(|(lhs, rhs)| match lhs {
Term::Terminal(_) => {
assert_eq!(rhs.len(), 1)
}
Term::Nonterminal(_) => {
assert_eq!(rhs.len(), 2)
}
})
}

#[test]
Expand Down

0 comments on commit 401dee9

Please sign in to comment.