Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transforms-crlf.spec.ts 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import crlf, { Ending } from '../../src/transforms/crlf';
  2. import getParser, { Parser } from '../../src/parser/index';
  3. import getStringifier, { Stringifier } from '../../src/stringifier/index';
  4. const tests = [
  5. [
  6. 'no CR',
  7. 'CRLF',
  8. `
  9. /**
  10. * description
  11. *
  12. */`,
  13. `
  14. /**\r
  15. * description\r
  16. *\r
  17. */\r`,
  18. ],
  19. [
  20. 'mixed',
  21. 'CRLF',
  22. `
  23. /**
  24. * description
  25. *\r
  26. */`,
  27. `
  28. /**\r
  29. * description\r
  30. *\r
  31. */\r`,
  32. ],
  33. [
  34. 'no CR',
  35. 'LF',
  36. `
  37. /**
  38. * description
  39. *
  40. */`,
  41. `
  42. /**
  43. * description
  44. *
  45. */`,
  46. ],
  47. [
  48. 'mixed',
  49. 'LF',
  50. `
  51. /**
  52. * description
  53. *\r
  54. */`,
  55. `
  56. /**
  57. * description
  58. *
  59. */`,
  60. ],
  61. ];
  62. test.each(tests)('CRLF - %s to %s', (name, mode, source, expected) => {
  63. expected = expected.slice(1);
  64. const parsed = getParser()(source);
  65. const normalized = crlf(mode as Ending)(parsed[0]);
  66. const out = getStringifier()(normalized);
  67. expect(out).toBe(expected);
  68. });