new fixes for lexing process, tests to go with them
This commit is contained in:
parent
5ed8a054d3
commit
72598c2168
3 changed files with 43 additions and 9 deletions
|
|
@ -58,6 +58,34 @@ mod lex_tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list_delim_in_str() {
|
||||
let document: &str = "('(')";
|
||||
match lex(document.to_string()) {
|
||||
Ok(tree) => {
|
||||
assert_eq!(ast_to_string(tree), document);
|
||||
},
|
||||
Err(s) => {
|
||||
print!("{}\n", s);
|
||||
assert!(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_string() {
|
||||
let document: &str = "('')";
|
||||
match lex(document.to_string()) {
|
||||
Ok(tree) => {
|
||||
assert_eq!(ast_to_string(tree), document);
|
||||
},
|
||||
Err(s) => {
|
||||
print!("{}\n", s);
|
||||
assert!(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unmatched_list_delim_flat() {
|
||||
let document: &str = "(one two";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue