]> git.draconx.ca Git - cdecl99.git/commitdiff
tests: Add more coverage for parenthesis handling.
authorNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 02:09:33 +0000 (22:09 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 2 Jul 2023 00:16:07 +0000 (20:16 -0400)
Add a couple extra test cases which cover some special behaviours
that are apparently missed by the existing tests.

tests/decl-bad.at
tests/decl-good.at

index c8b225e0cf32677571ec86b1a388f416c0e537ba..dc21ea112e311fe3cc39b38baf38e4149120d32e 100644 (file)
@@ -74,7 +74,9 @@ SIMPLE_BADDECL([Reject ... with no formal parameters],
   [declare f as function (...) returning void])
 
 SIMPLE_BADDECL([Reject identifier lists with extra parentheses],
-  [explain int f((x))])
+  [explain int f((x))],
+  [explain int f(())],
+  [explain int (())])
 
 SIMPLE_BADDECL([Reject parameter types with extra parentheses],
   [explain int ((int))])
index 1c948721572b872dd0b45ebca8ca318586624d0e..8acf26a686c102f7b63d28a5de5cc1ece2066285 100644 (file)
@@ -85,6 +85,13 @@ SIMPLE_DECLS(
 SIMPLE_DECLS(
   [[int (x*)], [type function (pointer to x) returning int], [int (x *)]])
 
+SIMPLE_DECLS(
+  [[int (x)()], [declare x as function returning int], [int x()]])
+
+dnl Check that function reduction does not occur in english parses
+SIMPLE_DECLS(
+  [[int (x)], [type function (x) returning int], [], [declare x as int]])
+
 SIMPLE_DECLS(
   [[int x@<:@@:>@], [declare x as array of int]],
   [[int @<:@@:>@],  [type array of int]])