examples: bistromathic: when quitting, close the current line

When the user ctrl-d the line, we left the cursor not at col 0.
Let's fix that.
This revealed a few short-comings in the testing framework.

* examples/test (run): Also display the diffs.
And support -n.
* examples/c/bistromathic/bistromathic.test
* examples/c/bistromathic/parse.y
This commit is contained in:
Akim Demaille
2020-04-25 14:54:47 +02:00
parent 3b50adf7f4
commit c90110efd3
3 changed files with 45 additions and 26 deletions

View File

@@ -543,7 +543,11 @@ int main (int argc, char const* argv[])
{
char *line = readline ("> ");
if (!line)
return 0;
{
// Finish the line started by the prompt.
putchar ('\n');
break;
}
if (*line)
add_history (line);
process_line (&lloc, line);