From: Philippe Proulx Date: Mon, 2 Oct 2023 15:55:48 +0000 (-0400) Subject: Add conditional block parsing failure tests X-Git-Tag: v0.10.0~1 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9f2ce91e06d63e6f2e51fe640d3c835e6bcfa11b;p=normand.git Add conditional block parsing failure tests Change-Id: I49da1387c68b2a521050b449ffe93c00d80f5e87 Signed-off-by: Philippe Proulx --- diff --git a/tests/fail-cond-blk-const-int.nt b/tests/fail-cond-blk-const-int.nt new file mode 100644 index 0000000..8f0fb28 --- /dev/null +++ b/tests/fail-cond-blk-const-int.nt @@ -0,0 +1,3 @@ +!if 17 ff !end +--- +1:5 - Expecting a name or `{` diff --git a/tests/fail-cond-blk-empty-expr.nt b/tests/fail-cond-blk-empty-expr.nt new file mode 100644 index 0000000..ccc1aea --- /dev/null +++ b/tests/fail-cond-blk-empty-expr.nt @@ -0,0 +1,3 @@ +!if { } 77 !end +--- +1:6 - Invalid expression ``: invalid syntax diff --git a/tests/fail-cond-blk-eval-type-1.nt b/tests/fail-cond-blk-eval-type-1.nt new file mode 100644 index 0000000..109c25e --- /dev/null +++ b/tests/fail-cond-blk-eval-type-1.nt @@ -0,0 +1,3 @@ +!if { [1, 2, 3] } 77 !end +--- +1:1 - Invalid expression `[1, 2, 3]`: expecting result type `int`, not `list` diff --git a/tests/fail-cond-blk-eval-type-2.nt b/tests/fail-cond-blk-eval-type-2.nt new file mode 100644 index 0000000..2965e73 --- /dev/null +++ b/tests/fail-cond-blk-eval-type-2.nt @@ -0,0 +1,3 @@ +!if {3.4} 77 !end +--- +1:1 - Invalid expression `3.4`: expecting result type `int`, not `float` diff --git a/tests/fail-cond-blk-eval.nt b/tests/fail-cond-blk-eval.nt new file mode 100644 index 0000000..fa28ad8 --- /dev/null +++ b/tests/fail-cond-blk-eval.nt @@ -0,0 +1,3 @@ +aa !if { 23 + zoom(14) } bb !end +--- +1:4 - Failed to evaluate expression `23 + zoom(14)`: name 'zoom' is not defined