Merge branch 'main' of github.com:Mathieu-Lala/rhai into fix/lint

This commit is contained in:
Mathieu Lala
2023-02-05 17:18:45 +01:00
23 changed files with 281 additions and 118 deletions

View File

@@ -144,6 +144,21 @@ fn test_functions_global_module() -> Result<(), Box<EvalAltResult>> {
123
);
// Other globals
let mut module = Module::new();
module.set_var("ANSWER", 123 as INT);
engine.register_global_module(module.into());
assert_eq!(
engine.eval::<INT>(
"
fn foo() { global::ANSWER }
foo()
"
)?,
123
);
Ok(())
}