X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/68ac70bc7bf365fa17bd6d7ea597fa0a05488b8d..d4dcde2b75d38e8098c5df8d1b61479b389f2c12:/tests/input.at?ds=inline diff --git a/tests/input.at b/tests/input.at index faa939c1..cd0dd6ac 100644 --- a/tests/input.at +++ b/tests/input.at @@ -813,6 +813,25 @@ input.y:19.13-20.0: error: missing '}' at end of file input.y:20.1: error: syntax error, unexpected end of file ]]) +AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [], +[[input.y:1.10-2.0: error: missing '"' at end of line + %token A "a + ^^ +input.y:4.10-5.0: error: missing "'" at end of line + %token C '1 + ^^ +input.y:14.11-15.0: error: missing "'" at end of line + %type 'a + ^^ +input.y:16.11-17.0: error: missing '"' at end of line + %type "a + ^^ +input.y:19.13-20.0: error: missing '}' at end of file + %destructor { free ($$) + ^^^^^^^^^^^ +input.y:20.1: error: syntax error, unexpected end of file +]]) + AT_CLEANUP @@ -1042,6 +1061,18 @@ start: ; ]]) AT_BISON_CHECK([[-Dvar=cmd-d input-dg.y]], [[1]], [], [[input-dg.y:1.9-11: error: %define variable 'var' redefined +:1: previous definition +]]) + +AT_DATA([[input-dg.y]], +[[%define var "gram" +%% +start: ; +]]) +AT_BISON_CHECK([[-fcaret -Dvar=cmd-d input-dg.y]], [[1]], [], +[[input-dg.y:1.9-11: error: %define variable 'var' redefined + %define var "gram" + ^^^ :2: previous definition ]]) @@ -1050,8 +1081,8 @@ AT_DATA([[input-unused.y]], start: ; ]]) AT_BISON_CHECK([[-Dunused-d -Funused-f input-unused.y]], [[1]], [], -[[:2: error: %define variable 'unused-d' is not used -:3: error: %define variable 'unused-f' is not used +[[:1: error: %define variable 'unused-d' is not used +:2: error: %define variable 'unused-f' is not used ]]) AT_CLEANUP @@ -1357,11 +1388,11 @@ start: ; # parse.lac.* options are useless if LAC isn't actually activated. AT_BISON_CHECK([[-Dparse.lac.es-capacity-initial=1 input.y]], [[1]], [], -[[:2: error: %define variable 'parse.lac.es-capacity-initial' is not used +[[:1: error: %define variable 'parse.lac.es-capacity-initial' is not used ]]) AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]], [[1]], [], -[[:2: error: %define variable 'parse.lac.memory-trace' is not used +[[:1: error: %define variable 'parse.lac.memory-trace' is not used ]]) AT_CLEANUP @@ -1420,8 +1451,8 @@ AT_BISON_CHECK([[$2 input.y]], [[1]], [[]], ]) AT_TEST([%define api.prefix foo %name-prefix "bar"], [], [input.y:1.9-18]) -AT_TEST([], [-Dapi.prefix=foo -p bar], [:2]) -AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [:2]) +AT_TEST([], [-Dapi.prefix=foo -p bar], [:1]) +AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [:1]) AT_TEST([%define api.prefix foo], [-p bar], [input.y:1.9-18]) m4_popdef([AT_TEST])