From dd6b673615dc9c7cc8e093e411131667d3ea250e Mon Sep 17 00:00:00 2001 From: John Doty Date: Tue, 2 Jan 2024 09:35:48 -0800 Subject: [PATCH] [fine] A few more tests --- oden-script/src/parser.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/oden-script/src/parser.rs b/oden-script/src/parser.rs index 2753a872..bc98d520 100644 --- a/oden-script/src/parser.rs +++ b/oden-script/src/parser.rs @@ -599,6 +599,18 @@ mod tests { "cannot apply unary operator '-' to expression of type 'string'" ); + test_type_error_expr!( + add_string_number, + "'what?' + 5", + "cannot apply binary operator '+' to expressions of type 'string' (on the left) and 'f64' (on the right)" + ); + + test_type_error_expr!( + add_number_string, + "5 + 'what?'", + "cannot apply binary operator '+' to expressions of type 'f64' (on the left) and 'string' (on the right)" + ); + test_type_error_expr!( errors_propagate_do_not_duplicate, "!'hello' / 27 * -('what?') + 23",