SeqUtils.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * SeqUtils tests.
  3. *
  4. * @author Chris van Marle
  5. * @copyright Copyright 2017
  6. * @license Apache-2.0
  7. */
  8. import TestRegister from "../../TestRegister.js";
  9. TestRegister.addTests([
  10. {
  11. name: "SeqUtils - Numeric sort photos",
  12. input: "Photo-1.jpg\nPhoto-4.jpg\nPhoto-2.jpg\nPhoto-3.jpg\n",
  13. expectedOutput: "Photo-1.jpg\nPhoto-2.jpg\nPhoto-3.jpg\nPhoto-4.jpg\n",
  14. recipeConfig: [
  15. {
  16. "op": "Sort",
  17. "args": ["Line feed", false, "Numeric"]
  18. }
  19. ],
  20. },
  21. {
  22. name: "SeqUtils - Numeric sort CVE IDs",
  23. input: "CVE-2017-1234,CVE-2017-9999,CVE-2017-10000,CVE-2017-10001,CVE-2017-12345,CVE-2016-1234,CVE-2016-4321,CVE-2016-10000,CVE-2016-9999,CVE-2016-10001",
  24. expectedOutput: "CVE-2017-12345,CVE-2017-10001,CVE-2017-10000,CVE-2017-9999,CVE-2017-1234,CVE-2016-10001,CVE-2016-10000,CVE-2016-9999,CVE-2016-4321,CVE-2016-1234",
  25. recipeConfig: [
  26. {
  27. "op": "Sort",
  28. "args": ["Comma", true, "Numeric"]
  29. }
  30. ],
  31. },
  32. ]);