diff --git a/tests/functions.rs b/tests/functions.rs index 8e4a7f36..af9b9ba0 100644 --- a/tests/functions.rs +++ b/tests/functions.rs @@ -143,6 +143,21 @@ fn test_functions_global_module() -> Result<(), Box> { 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::( + " + fn foo() { global::ANSWER } + foo() + " + )?, + 123 + ); + Ok(()) }