Add function call bang test.

This commit is contained in:
Stephen Chung 2021-11-10 22:10:03 +08:00
parent 93869b544c
commit 6b27ca19d5

View File

@ -143,3 +143,26 @@ fn test_functions_global_module() -> Result<(), Box<EvalAltResult>> {
Ok(()) Ok(())
} }
#[test]
fn test_functions_bang() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
assert_eq!(
engine.eval::<INT>(
"
fn foo() {
hello + bar
}
let hello = 42;
let bar = 123;
foo!()
",
)?,
165
);
Ok(())
}