Skip to content

Commit 0754938

Browse files
committed
Format errors on test failure. Fixes #214.
1 parent 306c247 commit 0754938

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bin/peggy-cli.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ export class PeggyCLI extends Command {
545545
sources: [{
546546
source: this.argv.grammarSource,
547547
text: input,
548+
}, {
549+
source: this.testGrammarSource,
550+
text: this.testText,
548551
}],
549552
});
550553
}

test/cli/run.spec.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,13 @@ Options:
944944
stdin: "foo='1'",
945945
errorCode: "peggy.cli",
946946
exitCode: 2,
947-
error: "end of input",
947+
error: `\
948+
Error running test
949+
Error: Expected "1" but end of input found.
950+
--> command line:1:1
951+
|
952+
1 |${" "}
953+
|`,
948954
});
949955
});
950956

0 commit comments

Comments
 (0)