Handle case when expected error and receives none

This commit is contained in:
toby 2017-02-23 14:30:19 -05:00
parent 3d89881373
commit 04df7a51d2
2 changed files with 19 additions and 1 deletions

View file

@ -74,7 +74,14 @@
].join("\n");
}
} else {
if (result.result === test.expectedOutput) {
if (test.expectedError) {
test.status = "failing";
test.output = [
"Failing",
"-------",
"Expected an error but did not receive one.",
].join("\n");
} else if (result.result === test.expectedOutput) {
test.status = "passing";
} else {
test.status = "failing";

View file

@ -21,6 +21,17 @@ TestRegister.addTests([
},
],
},
{
name: "Example non-error when error was expected",
input: "1",
expectedError: true,
recipeConfig: [
{
op: "To Base",
args: [16],
},
],
},
{
name: "Example fail",
input: "1\n2\na\n4",