l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

tap.js (1061B)


      1 /*
      2 Language: Test Anything Protocol
      3 Description: TAP, the Test Anything Protocol, is a simple text-based interface between testing modules in a test harness.
      4 Requires: yaml.js
      5 Author: Sergey Bronnikov <sergeyb@bronevichok.ru>
      6 Website: https://testanything.org
      7 */
      8 
      9 function tap(hljs) {
     10   return {
     11     name: 'Test Anything Protocol',
     12     case_insensitive: true,
     13     contains: [
     14       hljs.HASH_COMMENT_MODE,
     15       // version of format and total amount of testcases
     16       {
     17         className: 'meta',
     18         variants: [
     19           { begin: '^TAP version (\\d+)$' },
     20           { begin: '^1\\.\\.(\\d+)$' }
     21         ],
     22       },
     23       // YAML block
     24       {
     25         begin: '(\s+)?---$', end: '\\.\\.\\.$',
     26         subLanguage: 'yaml',
     27         relevance: 0
     28       },
     29 	  // testcase number
     30       {
     31         className: 'number',
     32         begin: ' (\\d+) '
     33       },
     34 	  // testcase status and description
     35       {
     36         className: 'symbol',
     37         variants: [
     38           { begin: '^ok' },
     39           { begin: '^not ok' }
     40         ],
     41       },
     42     ]
     43   };
     44 }
     45 
     46 module.exports = tap;