add list type check

This commit is contained in:
Ava Apples Affine 2023-07-30 12:26:02 -07:00
parent e3875d4652
commit 0babc1986a
4 changed files with 56 additions and 2 deletions

View file

@ -328,4 +328,38 @@ mod append_lib_tests {
result.to_string(),
);
}
#[test]
fn test_islist_t() {
let document = "(list? ())";
let result = "true";
let mut syms = SymTable::new();
static_stdlib(&mut syms);
dynamic_stdlib(&mut syms, None);
assert_eq!(
*eval(&lex(&document.to_string()).unwrap(), &mut syms)
.unwrap()
.to_string(),
result.to_string(),
);
}
#[test]
fn test_islist_f() {
let document = "(list? 1223)";
let result = "false";
let mut syms = SymTable::new();
static_stdlib(&mut syms);
dynamic_stdlib(&mut syms, None);
assert_eq!(
*eval(&lex(&document.to_string()).unwrap(), &mut syms)
.unwrap()
.to_string(),
result.to_string(),
);
}
}