subunit.js 982 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Language: SubUnit
  3. Author: Sergey Bronnikov <sergeyb@bronevichok.ru>
  4. Website: https://pypi.org/project/python-subunit/
  5. */
  6. function subunit(hljs) {
  7. const DETAILS = {
  8. className: 'string',
  9. begin: '\\[\n(multipart)?',
  10. end: '\\]\n'
  11. };
  12. const TIME = {
  13. className: 'string',
  14. begin: '\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}\.\\d+Z'
  15. };
  16. const PROGRESSVALUE = {
  17. className: 'string',
  18. begin: '(\\+|-)\\d+'
  19. };
  20. const KEYWORDS = {
  21. className: 'keyword',
  22. relevance: 10,
  23. variants: [
  24. {
  25. begin: '^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?'
  26. },
  27. {
  28. begin: '^progress(:?)(\\s+)?(pop|push)?'
  29. },
  30. {
  31. begin: '^tags:'
  32. },
  33. {
  34. begin: '^time:'
  35. }
  36. ]
  37. };
  38. return {
  39. name: 'SubUnit',
  40. case_insensitive: true,
  41. contains: [
  42. DETAILS,
  43. TIME,
  44. PROGRESSVALUE,
  45. KEYWORDS
  46. ]
  47. };
  48. }
  49. module.exports = subunit;