[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/13] tests: check that detailed error messages preserve UTF-8 c
From: |
Akim Demaille |
Subject: |
[PATCH 09/13] tests: check that detailed error messages preserve UTF-8 characters |
Date: |
Sat, 18 Jan 2020 16:40:08 +0100 |
* tests/regression.at: here.
---
tests/regression.at | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/tests/regression.at b/tests/regression.at
index b293fb35..41cef311 100644
--- a/tests/regression.at
+++ b/tests/regression.at
@@ -385,10 +385,10 @@ AT_DATA_GRAMMAR([input.y],
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%%
-exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
+exp: ]AT_ERROR_VERBOSE_IF(["\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"],
["∃¬∩∪∀"])[;
%%
]AT_YYERROR_DEFINE[
-]AT_YYLEX_DEFINE([{ SPECIAL }])[
+]AT_YYLEX_DEFINE(["a"])[
]AT_MAIN_DEFINE[
]])
@@ -410,20 +410,13 @@ input.y:22.16-63: warning: symbol
"\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used
AT_COMPILE([input])
-AT_ERROR_VERBOSE_IF([
# Checking the error message here guarantees that yytname, which does contain
# C-string literals, does have the trigraph escaped correctly. Thus, the
# symbol name reported by the parser is exactly the same as that reported by
# Bison itself.
-AT_DATA([experr],
-[[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!",
expecting a
+AT_PARSER_CHECK([input], 1, [],
+[[syntax error, unexpected a, expecting
]AT_ERROR_VERBOSE_IF([["\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!"]], [[∃¬∩∪∀]])[
]])
-AT_PARSER_CHECK([input], 1, [], [experr])
-])
-
-# We don't check the error message in "detailed" parse.error, since
-# the special characters are not longer escaped, and it produces
-# invalid UTF-8.
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
--
2.24.1
- [PATCH 00/13] Better error messages, Akim Demaille, 2020/01/18
- [PATCH 01/13] glr.c: move some functions after the definition of types, Akim Demaille, 2020/01/18
- [PATCH 02/13] c: use yysymbol_name in traces, Akim Demaille, 2020/01/18
- [PATCH 03/13] yacc.c: add support for parse.error detailed, Akim Demaille, 2020/01/18
- [PATCH 04/13] yacc.c: tests: check detailed error messages, Akim Demaille, 2020/01/18
- [PATCH 05/13] regen, Akim Demaille, 2020/01/18
- [PATCH 06/13] bison: use detailed error messages, Akim Demaille, 2020/01/18
- [PATCH 07/13] regen, Akim Demaille, 2020/01/18
- [PATCH 09/13] tests: check that detailed error messages preserve UTF-8 characters,
Akim Demaille <=
- [PATCH 08/13] yacc.c: escape trigraphs in detailed parse.error, Akim Demaille, 2020/01/18
- [PATCH 10/13] parsers: support translatable token aliases, Akim Demaille, 2020/01/18
- [PATCH 12/13] tests: check token internationalization, Akim Demaille, 2020/01/18
- [PATCH 13/13] parsers: issue tname with i18n markup, Akim Demaille, 2020/01/18
- [PATCH 11/13] regen, Akim Demaille, 2020/01/18
- Re: [PATCH 00/13] Better error messages, Akim Demaille, 2020/01/20