mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-15 02:26:54 -04:00
Levenshtein operation and operation search improved
This commit is contained in:
parent
ace8121d0e
commit
378c1ba07b
6 changed files with 195 additions and 6 deletions
|
@ -96,7 +96,7 @@ import "./tests/DefangIP.mjs";
|
|||
import "./tests/ParseUDP.mjs";
|
||||
import "./tests/AvroToJSON.mjs";
|
||||
import "./tests/Lorenz.mjs";
|
||||
|
||||
import "./tests/LevenshteinDistance.mjs";
|
||||
|
||||
// Cannot test operations that use the File type yet
|
||||
// import "./tests/SplitColourChannels.mjs";
|
||||
|
|
44
tests/operations/tests/LevenshteinDistance.mjs
Normal file
44
tests/operations/tests/LevenshteinDistance.mjs
Normal file
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Levenshtein distance tests.
|
||||
*
|
||||
* @author n1073645 [n1073645@gmail.com]
|
||||
* @copyright Crown Copyright 2020
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Levenshtein Distance",
|
||||
input: "the quick brown fox\n\nthequick br0wn g0x",
|
||||
expectedOutput: "Levenshtein Distance: 4",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Levenshtein Distance",
|
||||
input: "the quick brown fox\nthequick br0wn g0x",
|
||||
expectedOutput: "Error: double newline not present.",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Levenshtein Distance",
|
||||
input: "the quick brown fox\n\n",
|
||||
expectedOutput: "Levenshtein Distance: 19",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue