From d8b1af2801b4d3c8c0a422e2ce17548a0fa8e819 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 2 Oct 2001 15:36:11 +0000 Subject: [PATCH] * tests/calc.at: Now that --debug works, the tests must be adjusted. --- ChangeLog | 4 ++++ tests/calc.at | 51 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 900814f2..65895284 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-10-02 Akim Demaille + + * tests/calc.at: Now that --debug works, the tests must be adjusted. + 2001-10-02 Akim Demaille * src/output.c (output_parser): Assert `skeleton'. diff --git a/tests/calc.at b/tests/calc.at index 33e5d74f..8cce6cdc 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -261,18 +261,25 @@ m4_define([AT_DATA_CALC_Y], -# _AT_CHECK_CALC(BISON-OPTIONS, INPUT) -# ------------------------------------ +# _AT_CHECK_CALC(BISON-OPTIONS, INPUT, [NUM-STDERR-LINES = 0]) +# ------------------------------------------------------------ # Run `calc' on INPUT and expect no STDOUT nor STDERR. +# +# If BISON-OPTIONS contains `--debug', then NUM-STDERR-LINES is the number +# of expected lines on stderr. m4_define([_AT_CHECK_CALC], [AT_DATA([[input]], [[$2 ]]) -AT_CHECK([calc input])dnl +AT_CHECK([calc input], 0, [], [stderr])dnl +AT_CHECK([wc -l at-stderr +mv at-stderr stderr + +AT_CHECK([cat stderr], 0, +[m4_match([$1], [--location], [$4: ])[]dnl parse error[]dnl -m4_match([$1], [--yyerror-verbose], [, $4])[]dnl +m4_match([$1], [--yyerror-verbose], [, $5])[]dnl -])]) +]) + +]) # AT_CHECK_CALC([BISON-OPTIONS], [PARSER-EXPECTED-STDERR]) @@ -326,24 +348,25 @@ _AT_CHECK_CALC([$1], 1 - (2 - 3) = 2 2^2^3 = 256 -(2^2)^3 = 64], [$2]) +(2^2)^3 = 64], [491]) # Some parse errors. -_AT_CHECK_CALC_ERROR([$1], [+1], +_AT_CHECK_CALC_ERROR([$1], [+1], [8], [1.0:1.1], [unexpected `'+'']) -_AT_CHECK_CALC_ERROR([$1], [1//2], +_AT_CHECK_CALC_ERROR([$1], [1//2], [17], [1.2:1.3], [unexpected `'/'', expecting `NUM' or `'-'' or `'('']) -_AT_CHECK_CALC_ERROR([$1], [error], +_AT_CHECK_CALC_ERROR([$1], [error], [8], [1.0:1.1], [unexpected `$undefined.']) -_AT_CHECK_CALC_ERROR([$1], [1 = 2 = 3], +_AT_CHECK_CALC_ERROR([$1], [1 = 2 = 3], [23], [1.6:1.7], [unexpected `'='']) _AT_CHECK_CALC_ERROR([$1], [ +1], + [16], [2.0:2.1], [unexpected `'+'']) -- 2.50.0