tests: Add test for doubled parentheses.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 1 Jun 2022 19:09:43 +0000 (12:09 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 1 Jun 2022 22:22:05 +0000 (15:22 -0700)
I can't reproduce the problem reported in a bug report, but it seems
worthwhile to add a test for it anyway.

Bug #62557.

tests/language/expressions/evaluate.at

index 2500677fbeda83ae47140b5e450a6f684e8ef1b7..14059b83377a15a2311800aaf6868b1e101bea0f 100644 (file)
@@ -114,6 +114,12 @@ DEBUG EVALUATE /'string' - 1e10.
 DEBUG EVALUATE /9.5 - ''.
 
 DEBUG EVALUATE /F2.0 + 3.
+
+/* Bug #62557.
+DEBUG EVALUATE (y=3)(x=2) /(1 - y) + (1 - x).
+DEBUG EVALUATE (y=3)(x=2) /((1 - y) + (1 - x)).
+DEBUG EVALUATE (y=3)(x=2) /(1-y) + (1-x).
+DEBUG EVALUATE (y=3)(x=2) /( (1-y) + (1-x) ).
 ])
 
 for opt in OPT NOOPT; do
@@ -210,6 +216,14 @@ evaluate.sps:18.24: note: DEBUG EVALUATE: This operand has type 'number'.
       |                        ^
 
 F2.0 + 3 => error
+
+(1 - y) + (1 - x) => -3.00
+
+((1 - y) + (1 - x)) => -3.00
+
+(1-y) + (1-x) => -3.00
+
+( (1-y) + (1-x) ) => -3.00
 ])
 done
 AT_CLEANUP