Bring more functions into modules in plugins via rhai_fn(name) attribute.

This commit is contained in:
Stephen Chung
2020-08-16 23:41:59 +08:00
parent 31a05f8c48
commit e75d91e9bf
9 changed files with 210 additions and 244 deletions

View File

@@ -39,5 +39,14 @@ fn test_timestamp() -> Result<(), Box<EvalAltResult>> {
)? < 10
);
assert!(engine.eval::<bool>(
r"
let time1 = timestamp();
for x in range(0, 10000) {}
let time2 = timestamp();
time1 <= time2
"
)?);
Ok(())
}