tap.js 751 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports = function(hljs) {
  2. return {
  3. case_insensitive: true,
  4. contains: [
  5. hljs.HASH_COMMENT_MODE,
  6. // version of format and total amount of testcases
  7. {
  8. className: 'meta',
  9. variants: [
  10. { begin: '^TAP version (\\d+)$' },
  11. { begin: '^1\\.\\.(\\d+)$' }
  12. ],
  13. },
  14. // YAML block
  15. {
  16. begin: '(\s+)?---$', end: '\\.\\.\\.$',
  17. subLanguage: 'yaml',
  18. relevance: 0
  19. },
  20. // testcase number
  21. {
  22. className: 'number',
  23. begin: ' (\\d+) '
  24. },
  25. // testcase status and description
  26. {
  27. className: 'symbol',
  28. variants: [
  29. { begin: '^ok' },
  30. { begin: '^not ok' }
  31. ],
  32. },
  33. ]
  34. };
  35. };