From 2ffc88a22e18ae399cd3676cd30a754197ee3464 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 13 Jan 2022 13:52:51 +0200 Subject: [PATCH] Add failing examples from issue. Relates to #94 --- tests/integration.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 9d536c2..d6697b2 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1806,3 +1806,14 @@ fn test_value_type() { Ok(Value::String(String::new())) ); } + +#[test] +fn test_parenthese_combinations() { + // These are from issue #94 + dbg!(build_operator_tree("123(1*2)").unwrap()); + assert!(dbg!(eval("123(1*2)")).is_err()); + assert!(dbg!(eval("1()")).is_err()); + assert!(dbg!(eval("1()()()()")).is_err()); + assert!(dbg!(eval("1()()()(9)()()")).is_err()); + assert!(dbg!(eval_with_context("a+100+(a*2)", &context_map! {"a" => 4}.unwrap())).is_err()); +}