mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
examples: bistromathic: strengthen tests
* examples/c/bistromathic/bistromathic.test: here. * examples/test: Be clearer on failing tests.
This commit is contained in:
@@ -45,9 +45,20 @@ run 0 '0.16
|
|||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
*
|
*
|
||||||
EOF
|
EOF
|
||||||
run 0 "err: 1.1: syntax error: expected end of file or - or ( or end of line or double precision number or function or variable before *"
|
run 0 'err: 1.1: syntax error: expected end of file or - or ( or end of line or double precision number or function or variable before *'
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
1 + 2 * * 3
|
1 + 2 * * 3
|
||||||
EOF
|
EOF
|
||||||
run 0 "err: 1.9: syntax error: expected - or ( or double precision number or function or variable before *"
|
run 0 'err: 1.9: syntax error: expected - or ( or double precision number or function or variable before *'
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
100%
|
||||||
|
EOF
|
||||||
|
run 0 '100
|
||||||
|
err: 1.4: error: invalid character'
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
1 / 0
|
||||||
|
EOF
|
||||||
|
run 0 'err: 1.1-5: error: division by zero'
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ exp:
|
|||||||
{
|
{
|
||||||
if ($r == 0)
|
if ($r == 0)
|
||||||
{
|
{
|
||||||
yyerror (&@$, "division by zero");
|
yyerror (&@$, "error: division by zero");
|
||||||
YYERROR;
|
YYERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -62,6 +62,6 @@
|
|||||||
|
|
||||||
<<EOF>> return TOK_EOF;
|
<<EOF>> return TOK_EOF;
|
||||||
|
|
||||||
. yyerror (yylloc, "syntax error, invalid character");
|
. yyerror (yylloc, "error: invalid character");
|
||||||
%%
|
%%
|
||||||
/* Epilogue (C code). */
|
/* Epilogue (C code). */
|
||||||
|
|||||||
@@ -90,9 +90,12 @@ run ()
|
|||||||
echo "$me: PASS: $number"
|
echo "$me: PASS: $number"
|
||||||
else
|
else
|
||||||
echo "$me: FAIL: $number"
|
echo "$me: FAIL: $number"
|
||||||
echo "$me: expected output: $out_exp"
|
echo "$me: input:"
|
||||||
echo "$me: effective output: $out_eff"
|
sed -e 's/^/ /' input
|
||||||
cat err_eff
|
echo "$me: expected output:"
|
||||||
|
echo "$out_exp" | sed -e 's/^/ /'
|
||||||
|
echo "$me: effective output:"
|
||||||
|
echo "$out_eff" | sed -e 's/^/ /'
|
||||||
exit=false
|
exit=false
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user