Rename sub-scope/SubScope to module.

This commit is contained in:
Stephen Chung
2020-05-05 10:39:12 +08:00
parent 64036f69ca
commit 143861747d
10 changed files with 162 additions and 201 deletions

View File

@@ -1,15 +1 @@
use rhai::{EvalAltResult, Scope, SubScope, INT};
#[test]
#[cfg(not(feature = "no_import"))]
fn test_sub_scope() {
let mut my_scope = Scope::new();
let mut sub_scope = SubScope::new();
sub_scope.insert("x".to_string(), (42 as INT).into());
my_scope.push_sub_scope("my_plugin", sub_scope);
let s = my_scope.find_sub_scope("my_plugin").unwrap();
assert_eq!(*s.get("x").unwrap().downcast_ref::<INT>().unwrap(), 42);
}
use rhai::{EvalAltResult, Scope, INT};