2017-03-01 22:33:28 +01:00
|
|
|
/**
|
|
|
|
* StrUtils tests.
|
|
|
|
*
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
2017-03-23 18:52:20 +01:00
|
|
|
import TestRegister from "../../TestRegister.js";
|
2017-03-21 23:41:44 +01:00
|
|
|
|
2017-03-01 22:33:28 +01:00
|
|
|
TestRegister.addTests([
|
|
|
|
{
|
|
|
|
name: "Regex, non-HTML op",
|
|
|
|
input: "/<>",
|
|
|
|
expectedOutput: "/<>",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
"op": "Regular expression",
|
|
|
|
"args": ["User defined", "", true, true, false, "Highlight matches"]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"op": "Remove whitespace",
|
|
|
|
"args": [true, true, true, true, true, false]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
2017-03-27 20:39:04 +02:00
|
|
|
{
|
|
|
|
name: "Diff, basic usage",
|
|
|
|
input: "testing23\n\ntesting123",
|
|
|
|
expectedOutput: "testing<span class='hlgreen'>1</span>23",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
"op": "Diff",
|
|
|
|
"args": ["\\n\\n", "Character", true, true, false]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
2017-03-01 22:33:28 +01:00
|
|
|
]);
|