examples: bistromathic: strengthen tests

* examples/c/bistromathic/bistromathic.test: here.
* examples/test: Be clearer on failing tests.
This commit is contained in:
Akim Demaille
2020-02-29 12:11:37 +01:00
parent 388e12ac0f
commit c4a7e7a1ab
4 changed files with 21 additions and 7 deletions

View File

@@ -45,9 +45,20 @@ run 0 '0.16
cat >input <<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
1 + 2 * * 3
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'

View File

@@ -123,7 +123,7 @@ exp:
{
if ($r == 0)
{
yyerror (&@$, "division by zero");
yyerror (&@$, "error: division by zero");
YYERROR;
}
else

View File

@@ -62,6 +62,6 @@
<<EOF>> return TOK_EOF;
. yyerror (yylloc, "syntax error, invalid character");
. yyerror (yylloc, "error: invalid character");
%%
/* Epilogue (C code). */