No need to merge module if empty.
This commit is contained in:
@@ -237,6 +237,9 @@ fn test_module_from_ast() -> Result<(), Box<EvalAltResult>> {
|
||||
fn add_len(x, y) {
|
||||
x + len(y)
|
||||
}
|
||||
fn cross_call(x) {
|
||||
calc(x)
|
||||
}
|
||||
private fn hidden() {
|
||||
throw "you shouldn't see me!";
|
||||
}
|
||||
@@ -285,6 +288,10 @@ fn test_module_from_ast() -> Result<(), Box<EvalAltResult>> {
|
||||
engine.eval::<INT>(r#"import "testing" as ttt; ttt::calc(999)"#)?,
|
||||
1000
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(r#"import "testing" as ttt; ttt::cross_call(999)"#)?,
|
||||
1000
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(r#"import "testing" as ttt; ttt::add_len(ttt::foo, ttt::hello)"#)?,
|
||||
59
|
||||
|
Reference in New Issue
Block a user