commit 169c2530e45103ca2a8f60a5939008d2a98937be
Author: Akim Demaille <akim.demai...@gmail.com>
Date:   Wed Jan 15 07:13:25 2020 +0100

    tests: fix AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS pairs
    
    * tests/glr-regression.at, tests/java.at, tests/javapush.at:
    Close properly what is opened.
    Do not nest.

diff --git a/tests/glr-regression.at b/tests/glr-regression.at
index 11ba7841..1ad9f5a7 100644
--- a/tests/glr-regression.at
+++ b/tests/glr-regression.at
@@ -1700,7 +1700,6 @@ d: /* nada.  */;
 ]AT_YYLEX_DEFINE(["abc"])[
 ]AT_MAIN_DEFINE[
 ]])
-AT_BISON_OPTION_POPDEFS
 
 AT_BISON_CHECK([[-o input.c input.y]], 0, [],
 [[input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
@@ -1765,6 +1764,7 @@ Cleanup: popping nterm b ()
 Cleanup: popping token 'a' ()
 ])
 
+AT_BISON_OPTION_POPDEFS
 AT_CLEANUP
 
 
@@ -1777,6 +1777,7 @@ AT_CLEANUP
 
 AT_SETUP([Predicates])
 
+AT_BISON_OPTION_PUSHDEFS
 AT_DATA_GRAMMAR([input.y],
 [[%define parse.assert
 %glr-parser
@@ -1829,4 +1830,5 @@ AT_PARSER_CHECK([[input Owio]], [0], [old])
 AT_PARSER_CHECK([[input Nwio]], [1], [], [[syntax error, unexpected 'o', 
expecting 'n'
 ]])
 
+AT_BISON_OPTION_POPDEFS
 AT_CLEANUP
diff --git a/tests/java.at b/tests/java.at
index 02564d42..28a3377b 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -56,7 +56,6 @@ AT_CLEANUP
 m4_define([_AT_DATA_JAVA_CALC_Y],
 [m4_if([$1$2$3], $[1]$[2]$[3], [],
        [m4_fatal([$0: Invalid arguments: $@])])dnl
-AT_BISON_OPTION_PUSHDEFS([%language "Java" $4])
 AT_DATA_GRAMMAR([Calc.y],
 [[/* Infix notation calculator--calc */
 %language "Java"
@@ -183,8 +182,6 @@ class CalcLexer implements Calc.Lexer {
 }]])[
 ]AT_JAVA_POSITION_DEFINE[
 ]])
-
-AT_BISON_OPTION_POPDEFS
 ])# _AT_DATA_JAVA_CALC_Y
 
 
@@ -240,7 +237,7 @@ m4_define([_AT_CHECK_JAVA_CALC],
 [# We use integers to avoid dependencies upon the precision of doubles.
 AT_SETUP([Calculator $1])
 
-AT_BISON_OPTION_PUSHDEFS([$1])
+AT_BISON_OPTION_PUSHDEFS([%language "Java" $1])
 
 AT_DATA_JAVA_CALC_Y([$1
 %code {
@@ -318,6 +315,7 @@ _AT_CHECK_JAVA_CALC_ERROR([$1], [(- *) + (0 0) = 1],
 [1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
 1.8: syntax error, unexpected number
 1.1-1.11: calc: error: 2222 != 1])
+
 AT_BISON_OPTION_POPDEFS
 
 AT_CLEANUP
diff --git a/tests/javapush.at b/tests/javapush.at
index 33fadc9c..4f79c006 100644
--- a/tests/javapush.at
+++ b/tests/javapush.at
@@ -864,4 +864,7 @@ AT_CHECK([[sed -e '/^Next token.*$/p' -e d 
./stderr]],[ignore],[expout],[ignore-
 # 2. Check that the calculator output matches that of a pull parser
 AT_CHECK([[rm -f ./expout; cp -f ./output 
./expout]],[ignore],[ignore-nolog],[ignore-nolog])
 AT_CHECK([[cat ./stdout]],[ignore],[expout],[ignore-nolog])
+
+
+AT_BISON_OPTION_POPDEFS
 AT_CLEANUP


Reply via email to