Add allow_looping.

This commit is contained in:
Stephen Chung
2021-12-03 11:24:38 +08:00
parent 7cd76c6d18
commit fd26654125
4 changed files with 37 additions and 7 deletions

View File

@@ -22,5 +22,11 @@ fn test_options() -> Result<(), Box<EvalAltResult>> {
assert!(engine.compile("let x = || 42;").is_err());
engine.compile("while x > y { foo(z); }")?;
engine.set_allow_looping(false);
assert!(engine.compile("while x > y { foo(z); }").is_err());
Ok(())
}