Skip to content

Commit

Permalink
add test case for "illegal" tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Aug 5, 2024
1 parent 6aa1940 commit 95ac863
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,9 @@ mod tests {
);

run_lexer("= 5", &[Token::Assign, Token::Int(5)]);

// NOTE: see `rustc --explain E0277`
const ILLEGAL: Token = Token::Illegal;
run_lexer(r##"_"#$%&'.:?@[]^_`|~"##, &[ILLEGAL; 18]);
}
}

0 comments on commit 95ac863

Please sign in to comment.