tap.js 875 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. Language: Test Anything Protocol
  3. Requires: yaml.js
  4. Author: Sergey Bronnikov <[email protected]>
  5. Website: https://bronevichok.ru/
  6. */
  7. function(hljs) {
  8. return {
  9. case_insensitive: true,
  10. contains: [
  11. hljs.HASH_COMMENT_MODE,
  12. // version of format and total amount of testcases
  13. {
  14. className: 'meta',
  15. variants: [
  16. { begin: '^TAP version (\\d+)$' },
  17. { begin: '^1\\.\\.(\\d+)$' }
  18. ],
  19. },
  20. // YAML block
  21. {
  22. begin: '(\s+)?---$', end: '\\.\\.\\.$',
  23. subLanguage: 'yaml',
  24. relevance: 0
  25. },
  26. // testcase number
  27. {
  28. className: 'number',
  29. begin: ' (\\d+) '
  30. },
  31. // testcase status and description
  32. {
  33. className: 'symbol',
  34. variants: [
  35. { begin: '^ok' },
  36. { begin: '^not ok' }
  37. ],
  38. },
  39. ]
  40. };
  41. }