added env function and test
This commit is contained in:
parent
79184b18ef
commit
f22d807b57
5 changed files with 55 additions and 1 deletions
|
|
@ -249,4 +249,20 @@ mod var_lib_tests {
|
|||
assert!(!b);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_env_doesnt_lose_elements() {
|
||||
let doc1 = "(def t '' 1)";
|
||||
let doc2 = "(env)";
|
||||
let doc3 = "t";
|
||||
let mut syms = SymTable::new();
|
||||
static_stdlib(&mut syms).unwrap();
|
||||
dynamic_stdlib(&mut syms).unwrap();
|
||||
let set_tree = lex(&doc1.to_string()).unwrap();
|
||||
let env_tree = lex(&doc2.to_string()).unwrap();
|
||||
let tst_tree = lex(&doc3.to_string()).unwrap();
|
||||
eval(&set_tree, &mut syms).unwrap();
|
||||
eval(&env_tree, &mut syms).unwrap();
|
||||
eval(&tst_tree, &mut syms).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue