Revise tests

This commit is contained in:
Jeff 2024-01-23 14:06:58 -05:00
parent 4e61c6dd6e
commit 8224f7fe3c
2 changed files with 16 additions and 16 deletions

View File

@ -18,6 +18,7 @@ fn async_download() {
}
#[test]
#[ignore]
fn clue_solver() {
let file_contents = read_to_string("examples/clue_solver.ds").unwrap();
@ -33,6 +34,7 @@ fn fetch() {
}
#[test]
#[ignore]
fn fibonacci() {
let file_contents = read_to_string("examples/fibonacci.ds").unwrap();

View File

@ -48,16 +48,14 @@ fn built_in_function_call() {
#[test]
fn function_context_does_not_capture_normal_values() {
assert_eq!(
interpret(
assert!(interpret(
"
x = 1
foo = () <any> { x }
"
),
Err(Error::VariableIdentifierNotFound("x".to_string()))
);
)
.is_err_and(|error| error.is_error(&Error::VariableIdentifierNotFound("x".to_string()))));
assert_eq!(
interpret(
@ -84,16 +82,16 @@ fn function_context_captures_functions() {
Ok(Value::Integer(2))
);
// assert_eq!(
// interpret(
// "
// foo = () <int> { bar() }
// foo()
// bar = () <int> { 2 }
// "
// ),
// Ok(Value::Integer(2))
// );
assert_eq!(
interpret(
"
foo = () <int> { bar() }
foo()
bar = () <int> { 2 }
"
),
Ok(Value::Integer(2))
);
}
#[test]