Allow stacking ! operators.
This commit is contained in:
@@ -62,9 +62,9 @@ fn test_internal_fn_overloading() -> Result<(), Box<EvalAltResult>> {
|
||||
*engine
|
||||
.compile(
|
||||
r"
|
||||
fn abc(x) { x + 42 }
|
||||
fn abc(x) { x - 42 }
|
||||
"
|
||||
fn abc(x) { x + 42 }
|
||||
fn abc(x) { x - 42 }
|
||||
"
|
||||
)
|
||||
.expect_err("should error")
|
||||
.0,
|
||||
|
@@ -12,8 +12,7 @@ fn test_not() -> Result<(), Box<EvalAltResult>> {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
assert_eq!(engine.eval::<bool>("fn not(x) { !x } not(false)")?, true);
|
||||
|
||||
// TODO - do we allow stacking unary operators directly? e.g '!!!!!!!true'
|
||||
assert_eq!(engine.eval::<bool>("!(!(!(!(true))))")?, true);
|
||||
assert_eq!(engine.eval::<bool>("!!!!true")?, true);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user