Add function call bang test.
This commit is contained in:
parent
93869b544c
commit
6b27ca19d5
@ -143,3 +143,26 @@ fn test_functions_global_module() -> Result<(), Box<EvalAltResult>> {
|
||||
|
||||
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(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user