StrUtils.js 953 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * StrUtils tests.
  3. *
  4. * @author n1474335 [n1474335@gmail.com]
  5. * @copyright Crown Copyright 2017
  6. * @license Apache-2.0
  7. */
  8. import TestRegister from "../../TestRegister.js";
  9. TestRegister.addTests([
  10. {
  11. name: "Regex, non-HTML op",
  12. input: "/<>",
  13. expectedOutput: "/<>",
  14. recipeConfig: [
  15. {
  16. "op": "Regular expression",
  17. "args": ["User defined", "", true, true, false, "Highlight matches"]
  18. },
  19. {
  20. "op": "Remove whitespace",
  21. "args": [true, true, true, true, true, false]
  22. }
  23. ],
  24. },
  25. {
  26. name: "Diff, basic usage",
  27. input: "testing23\n\ntesting123",
  28. expectedOutput: "testing<span class='hlgreen'>1</span>23",
  29. recipeConfig: [
  30. {
  31. "op": "Diff",
  32. "args": ["\\n\\n", "Character", true, true, false]
  33. }
  34. ],
  35. },
  36. ]);