Magic.mjs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Magic tests.
  3. *
  4. * @author n1474335 [n1474335@gmail.com]
  5. *
  6. * @copyright Crown Copyright 2018
  7. * @license Apache-2.0
  8. */
  9. import TestRegister from "../../TestRegister";
  10. TestRegister.addTests([
  11. {
  12. name: "Magic: nothing",
  13. input: "",
  14. expectedOutput: "Nothing of interest could be detected about the input data.\nHave you tried modifying the operation arguments?",
  15. recipeConfig: [
  16. {
  17. op: "Magic",
  18. args: [3, false, false]
  19. }
  20. ],
  21. },
  22. {
  23. name: "Magic: hex",
  24. input: "41 42 43 44 45",
  25. expectedMatch: /"#recipe=From_Hex\('Space'\)"/,
  26. recipeConfig: [
  27. {
  28. op: "Magic",
  29. args: [3, false, false]
  30. }
  31. ],
  32. },
  33. {
  34. name: "Magic: jpeg",
  35. input: "\xFF\xD8\xFF",
  36. expectedMatch: /Render_Image\('Raw'\)/,
  37. recipeConfig: [
  38. {
  39. op: "Magic",
  40. args: [3, false, false]
  41. }
  42. ],
  43. },
  44. {
  45. name: "Magic: mojibake",
  46. input: "d091d18bd100d182d180d0b0d10020d0bad0bed180d0b8d187d0bdd0b5d0b2d0b0d10020d0bbd0b8d100d0b020d0bfd180d18bd0b3d0b0d0b5d18220d187d0b5d180d0b5d0b720d0bbd0b5d0bdd0b8d0b2d183d18e20d100d0bed0b1d0b0d0bad1832e",
  47. expectedMatch: /Быртрар коричневар лира прыгает через ленивую робаку./,
  48. recipeConfig: [
  49. {
  50. op: "Magic",
  51. args: [3, true, false]
  52. }
  53. ],
  54. },
  55. ]);