aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2017-12-31 14:54:33 +0000
committerAleksey Kladov <[email protected]>2017-12-31 14:54:33 +0000
commit9ce4db545efba697f20ab5cecbefc0589c7146ca (patch)
treeecda02126426b473bf2f70777a148e569c114c98 /tests
parent98a58bf806ffda1b4d3352ed0f3e494fa25c8c74 (diff)
Parser: groundwork
Diffstat (limited to 'tests')
-rw-r--r--tests/lexer.rs14
1 files changed, 1 insertions, 13 deletions
diff --git a/tests/lexer.rs b/tests/lexer.rs
index 6a9bab66b..beca19c24 100644
--- a/tests/lexer.rs
+++ b/tests/lexer.rs
@@ -7,7 +7,7 @@ use std::path::{PathBuf, Path};
7use std::fs::read_dir; 7use std::fs::read_dir;
8use std::fmt::Write; 8use std::fmt::Write;
9 9
10use libsyntax2::{Token, next_token}; 10use libsyntax2::{Token, tokenize};
11 11
12#[test] 12#[test]
13fn lexer_tests() { 13fn lexer_tests() {
@@ -53,18 +53,6 @@ fn lexer_test_case(path: &Path) {
53 assert_diff!(expected, actual, "\n", 0) 53 assert_diff!(expected, actual, "\n", 0)
54} 54}
55 55
56fn tokenize(text: &str) -> Vec<Token> {
57 let mut text = text;
58 let mut acc = Vec::new();
59 while !text.is_empty() {
60 let token = next_token(text);
61 acc.push(token);
62 let len: u32 = token.len.into();
63 text = &text[len as usize..];
64 }
65 acc
66}
67
68fn dump_tokens(tokens: &[Token], text: &str) -> String { 56fn dump_tokens(tokens: &[Token], text: &str) -> String {
69 let mut acc = String::new(); 57 let mut acc = String::new();
70 let mut offset = 0; 58 let mut offset = 0;