SetIntersection.mjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Set Operations tests.
  3. *
  4. * @author d98762625
  5. *
  6. * @copyright Crown Copyright 2017
  7. * @license Apache-2.0
  8. */
  9. import TestRegister from "../../TestRegister";
  10. TestRegister.addTests([
  11. {
  12. name: "Set Intersection",
  13. input: "1 2 3 4 5\n\n3 4 5 6 7",
  14. expectedOutput: "3 4 5",
  15. recipeConfig: [
  16. {
  17. op: "Set Intersection",
  18. args: ["\n\n", " "],
  19. },
  20. ],
  21. },
  22. {
  23. name: "Set Intersection: only one set",
  24. input: "1 2 3 4 5 6 7 8",
  25. expectedOutput: "Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
  26. recipeConfig: [
  27. {
  28. op: "Set Intersection",
  29. args: ["\n\n", " "],
  30. },
  31. ],
  32. },
  33. {
  34. name: "Set Intersection: item delimiter",
  35. input: "1-2-3-4-5\n\n3-4-5-6-7",
  36. expectedOutput: "3-4-5",
  37. recipeConfig: [
  38. {
  39. op: "Set Intersection",
  40. args: ["\n\n", "-"],
  41. },
  42. ],
  43. },
  44. {
  45. name: "Set Intersection: sample delimiter",
  46. input: "1-2-3-4-5z3-4-5-6-7",
  47. expectedOutput: "3-4-5",
  48. recipeConfig: [
  49. {
  50. op: "Set Intersection",
  51. args: ["z", "-"],
  52. },
  53. ],
  54. }
  55. ]);