mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Handle case when expected error and receives none
This commit is contained in:
parent
3d89881373
commit
04df7a51d2
2 changed files with 19 additions and 1 deletions
|
@ -74,7 +74,14 @@
|
||||||
].join("\n");
|
].join("\n");
|
||||||
}
|
}
|
||||||
} else {
|
} 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";
|
test.status = "passing";
|
||||||
} else {
|
} else {
|
||||||
test.status = "failing";
|
test.status = "failing";
|
||||||
|
|
|
@ -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",
|
name: "Example fail",
|
||||||
input: "1\n2\na\n4",
|
input: "1\n2\na\n4",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue