From: Joel E. Denny Date: Wed, 26 Aug 2009 18:15:53 +0000 (-0400) Subject: tests: show a use of %define lr.default-reductions "consistent" X-Git-Tag: v2.5_rc1~178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d63e12792a61d1169c2cd847c622e9a115afa4d4;p=platform%2Fupstream%2Fbison.git tests: show a use of %define lr.default-reductions "consistent" * tests/conflicts.at (%nonassoc and eof): Extend to test that it prevents the omission of expected tokens for %error-verbose. (cherry picked from commit d1cc31c5f04b81a3620fa291020ce23490f3f9e7) --- diff --git a/ChangeLog b/ChangeLog index 87191e2..80f58f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-26 Joel E. Denny + + tests: show a use of %define lr.default-reductions "consistent" + * tests/conflicts.at (%nonassoc and eof): Extend to test that it + prevents the omission of expected tokens for %error-verbose. + 2009-08-26 Akim Demaille tests: portability fix. diff --git a/tests/conflicts.at b/tests/conflicts.at index bcc13bb..6fefea0 100644 --- a/tests/conflicts.at +++ b/tests/conflicts.at @@ -112,6 +112,29 @@ AT_PARSER_CHECK([./input '0<0>0'], [1], [], [syntax error, unexpected '>' ]) +# We must disable default reductions in inconsistent states in order to +# have an explicit list of all expected tokens. (However, unless we use +# canonical LR, lookahead sets are merged for different left contexts, +# so it is still possible to have extra incorrect tokens in the expected +# list. That just doesn't happen to be a problem for this test case.) + +AT_BISON_CHECK([-Dlr.default-reductions=consistent -o input.c input.y]) +AT_COMPILE([input]) + +AT_PARSER_CHECK([./input '0<0']) +AT_PARSER_CHECK([./input '0<0<0'], [1], [], + [syntax error, unexpected '<', expecting $end +]) + +AT_PARSER_CHECK([./input '0>0']) +AT_PARSER_CHECK([./input '0>0>0'], [1], [], + [syntax error, unexpected '>', expecting $end +]) + +AT_PARSER_CHECK([./input '0<0>0'], [1], [], + [syntax error, unexpected '>', expecting $end +]) + AT_CLEANUP