[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tests: really check complaints from m4
From: |
Akim Demaille |
Subject: |
tests: really check complaints from m4 |
Date: |
Sun, 3 Nov 2019 10:37:43 +0100 |
The previous test, with 🌞, is troublesome in two ways. First, it misses the
point, which is to exercise complaints used from the backends. Second, when
enabling this tests on GNU/Linux
(https://lists.gnu.org/archive/html/bison-patches/2019-11/msg00000.html) it
also revealed that macOS and GNU/Linux don't agree on the width of 🌞: one
column for the former (although it does display it on two columns), two for the
latter. I don't want to have to deal with this in the test suite.
commit 47b9ada6fa130611168a3a77facbf791c7886277
Author: Akim Demaille <address@hidden>
Date: Sun Nov 3 09:22:44 2019 +0100
tests: really check complaints from m4
* tests/diagnostics.at (Locations from M4, Tabulations and multibyte
characters from M4): These tests are actually checking a message
coming from C, not from M4. Replace with...
(Complaints from M4): This.
diff --git a/tests/diagnostics.at b/tests/diagnostics.at
index 70ba63fb..bfbb5eab 100644
--- a/tests/diagnostics.at
+++ b/tests/diagnostics.at
@@ -233,49 +233,26 @@ input.y: <warning>warning:</warning> fix-its can be
applied. Rerun with option
]])
-## ------------------- ##
-## Locations from M4. ##
-## ------------------- ##
+## -------------------- ##
+## Complaints from M4. ##
+## -------------------- ##
-# Locations coming from m4 need the byte-column for diagnostics.
+# Complaints issued m4 need complete locations (byte and column) for
+# diagnostics.
-AT_TEST([[Locations from M4]],
-[[%define api.prefix {foo}
-%define api.prefix {bar}
+AT_TEST([[Complaints from M4]],
+[[%define error1 {e}
+%define error2 {é}
%%
-exp:;
-]],
-[1],
-[[input.y:10.1-24: <error>error:</error> %define variable 'api.prefix'
redefined
- 10 | <error>%define api.prefix {bar}</error>
- | <error>^~~~~~~~~~~~~~~~~~~~~~~~</error>
-input.y:9.1-24: previous definition
- 9 | <note>%define api.prefix {foo}</note>
- | <note>^~~~~~~~~~~~~~~~~~~~~~~~</note>
-input.y: <warning>warning:</warning> fix-its can be applied. Rerun with
option '--update'. [<warning>-Wother</warning>]
-]])
-
-
-## ---------------------------------------------- ##
-## Tabulations and multibyte characters from M4. ##
-## ---------------------------------------------- ##
-
-# Locations coming from m4 need the byte-column for diagnostics.
-
-AT_TEST([[Tabulations and multibyte characters from M4]],
-[[%define api.prefix {sun}
-%define api.prefix {🌞}
-%%
-exp:;
+exp: %empty;
]],
[1],
-[[input.y:10.1-35: <error>error:</error> %define variable 'api.prefix'
redefined
- 10 | <error>%define api.prefix {🌞}</error>
- | <error>^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</error>
-input.y:9.1-37: previous definition
- 9 | <note>%define api.prefix {sun}</note>
- | <note>^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</note>
-input.y: <warning>warning:</warning> fix-its can be applied. Rerun with
option '--update'. [<warning>-Wother</warning>]
+[[input.y:9.1-27: <error>error:</error> %define variable 'error1' is not used
+ 9 | <error>%define error1 {e}</error>
+ | <error>^~~~~~~~~~~~~~~~~~~~~~~~~~~</error>
+input.y:10.1-27: <error>error:</error> %define variable 'error2' is not used
+ 10 | <error>%define error2 {é}</error>
+ | <error>^~~~~~~~~~~~~~~~~~~~~~~~~~~</error>
]])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- tests: really check complaints from m4,
Akim Demaille <=