Move lexer tests to a #[cfg(test)] mod tests { } modules
This commit is contained in:
parent
81a84a796a
commit
5a28b06434
1 changed files with 41 additions and 34 deletions
|
|
@ -192,6 +192,12 @@ impl Iterator for Lexer {
|
|||
// UNIT TESTING
|
||||
//
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::iter::Iterator;
|
||||
use super::*;
|
||||
use super::token::*;
|
||||
|
||||
#[test]
|
||||
fn lexer_finds_parens() {
|
||||
let mut lexer = Lexer::new("()");
|
||||
|
|
@ -232,3 +238,4 @@ fn assert_next_token(lexer: &mut Lexer, expected: &Token) {
|
|||
let lex = lexer.next().unwrap();
|
||||
assert_eq!(lex.token, *expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue