From 47b9ada6fa130611168a3a77facbf791c7886277 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 3 Nov 2019 09:22:44 +0100 Subject: [PATCH] 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. --- tests/diagnostics.at | 53 +++++++++++++------------------------------- 1 file changed, 15 insertions(+), 38 deletions(-) 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: 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:; +exp: %empty; ]], [1], -[[input.y:10.1-24: error: %define variable 'api.prefix' redefined - 10 | %define api.prefix {bar} - | ^~~~~~~~~~~~~~~~~~~~~~~~ -input.y:9.1-24: previous definition - 9 | %define api.prefix {foo} - | ^~~~~~~~~~~~~~~~~~~~~~~~ -input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] -]]) - - -## ---------------------------------------------- ## -## 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:; -]], -[1], -[[input.y:10.1-35: error: %define variable 'api.prefix' redefined - 10 | %define api.prefix {🌞} - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -input.y:9.1-37: previous definition - 9 | %define api.prefix {sun} - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] +[[input.y:9.1-27: error: %define variable 'error1' is not used + 9 | %define error1 {e} + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +input.y:10.1-27: error: %define variable 'error2' is not used + 10 | %define error2 {é} + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ]])