mirror of
https://github.com/gchq/CyberChef
synced 2025-12-15 15:53:30 +00:00
diff.mjs: Fixes tests and adds default flag
* Sets default flag to `false` for `showSubtraction` flag.
* Removes extra span for else case that was causing some tests to
fail. Moreover, the previous behavior was defined as that.
* Adds custom test for the showSubtraction option, both using the
`showAdded` and `showRemoved` flags.
This commit is contained in:
@@ -15,7 +15,29 @@ TestRegister.addTests([
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Diff",
|
||||
"args": ["\\n\\n", "Character", true, true, false]
|
||||
"args": ["\\n\\n", "Character", true, true, false, false]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Diff added with subtraction, basic usage",
|
||||
input: "testing23\n\ntesting123",
|
||||
expectedOutput: "<span class='hl5'>1</span>",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Diff",
|
||||
"args": ["\\n\\n", "Character", true, true, true, false]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Diff removed with subtraction, basic usage",
|
||||
input: "testing123\n\ntesting3",
|
||||
expectedOutput: "<span class='hl3'>12</span>",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Diff",
|
||||
"args": ["\\n\\n", "Character", true, true, true, false]
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user