diff options
Diffstat (limited to 'tests/lexer.rs')
-rw-r--r-- | tests/lexer.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/lexer.rs b/tests/lexer.rs index 20840f456..397ebafdd 100644 --- a/tests/lexer.rs +++ b/tests/lexer.rs | |||
@@ -4,18 +4,15 @@ extern crate testutils; | |||
4 | 4 | ||
5 | use std::fmt::Write; | 5 | use std::fmt::Write; |
6 | 6 | ||
7 | use libsyntax2::{Token, tokenize}; | 7 | use libsyntax2::{tokenize, Token}; |
8 | use testutils::dir_tests; | 8 | use testutils::dir_tests; |
9 | 9 | ||
10 | #[test] | 10 | #[test] |
11 | fn lexer_tests() { | 11 | fn lexer_tests() { |
12 | dir_tests( | 12 | dir_tests(&["lexer"], |text| { |
13 | &["lexer"], | 13 | let tokens = tokenize(text); |
14 | |text| { | 14 | dump_tokens(&tokens, text) |
15 | let tokens = tokenize(text); | 15 | }) |
16 | dump_tokens(&tokens, text) | ||
17 | } | ||
18 | ) | ||
19 | } | 16 | } |
20 | 17 | ||
21 | fn dump_tokens(tokens: &[Token], text: &str) -> String { | 18 | fn dump_tokens(tokens: &[Token], text: &str) -> String { |
@@ -29,4 +26,4 @@ fn dump_tokens(tokens: &[Token], text: &str) -> String { | |||
29 | write!(acc, "{:?} {} {:?}\n", token.kind, token.len, token_text).unwrap() | 26 | write!(acc, "{:?} {} {:?}\n", token.kind, token.len, token_text).unwrap() |
30 | } | 27 | } |
31 | acc | 28 | acc |
32 | } \ No newline at end of file | 29 | } |