new fixes for lexing process, tests to go with them

This commit is contained in:
Aidan Hahn 2021-09-18 16:48:24 -07:00
parent 5ed8a054d3
commit 72598c2168
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 43 additions and 9 deletions

View file

@ -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";