refmt
This commit is contained in:
parent
f805290a4b
commit
be73b0b828
17 changed files with 588 additions and 675 deletions
|
|
@ -1,8 +1,8 @@
|
|||
mod var_lib_tests {
|
||||
use relish::stdlib::{get_stdlib};
|
||||
use relish::ast::{lex, eval, VTable, FTable, Ctr};
|
||||
use std::rc::Rc;
|
||||
use relish::ast::{eval, lex, Ctr, FTable, VTable};
|
||||
use relish::stdlib::get_stdlib;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[test]
|
||||
fn test_variable_export_and_lookup() {
|
||||
|
|
@ -24,47 +24,41 @@ mod var_lib_tests {
|
|||
Err(s) => {
|
||||
println!("Couldnt lex {}: {}", doc1, s);
|
||||
assert!(false);
|
||||
},
|
||||
}
|
||||
|
||||
Ok(tree) => {
|
||||
match eval(tree, vt.clone(), ft.clone(), false) {
|
||||
Err(s) => {
|
||||
println!("Couldnt eval {}: {}", doc2, s);
|
||||
assert!(false);
|
||||
},
|
||||
Ok(tree) => match eval(tree, vt.clone(), ft.clone(), false) {
|
||||
Err(s) => {
|
||||
println!("Couldnt eval {}: {}", doc2, s);
|
||||
assert!(false);
|
||||
}
|
||||
|
||||
Ok(ctr) => {
|
||||
println!("{:#?}", vt);
|
||||
match ctr {
|
||||
Ctr::None => assert!(true),
|
||||
_ => assert!(false)
|
||||
}
|
||||
Ok(ctr) => {
|
||||
println!("{:#?}", vt);
|
||||
match ctr {
|
||||
Ctr::None => assert!(true),
|
||||
_ => assert!(false),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
match lex(doc2.to_string()) {
|
||||
Err(s) => {
|
||||
println!("Couldnt lex {}: {}", doc2, s);
|
||||
assert!(false);
|
||||
},
|
||||
|
||||
Ok(tree) => {
|
||||
match eval(tree, vt.clone(), ft.clone(), false) {
|
||||
Err(s) => {
|
||||
println!("Couldnt eval {}: {}", doc2, s);
|
||||
assert!(false);
|
||||
},
|
||||
|
||||
Ok(ctr) => {
|
||||
match ctr {
|
||||
Ctr::String(s) => assert_eq!(s, result),
|
||||
_ => assert!(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(tree) => match eval(tree, vt.clone(), ft.clone(), false) {
|
||||
Err(s) => {
|
||||
println!("Couldnt eval {}: {}", doc2, s);
|
||||
assert!(false);
|
||||
}
|
||||
|
||||
Ok(ctr) => match ctr {
|
||||
Ctr::String(s) => assert_eq!(s, result),
|
||||
_ => assert!(false),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue