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 | {
|
20 | begin: '^TAP version (\\d+)$'
|
21 | },
|
22 | {
|
23 | begin: '^1\\.\\.(\\d+)$'
|
24 | }
|
25 | ]
|
26 | },
|
27 | // YAML block
|
28 | {
|
29 | begin: /---$/,
|
30 | end: '\\.\\.\\.$',
|
31 | subLanguage: 'yaml',
|
32 | relevance: 0
|
33 | },
|
34 | // testcase number
|
35 | {
|
36 | className: 'number',
|
37 | begin: ' (\\d+) '
|
38 | },
|
39 | // testcase status and description
|
40 | {
|
41 | className: 'symbol',
|
42 | variants: [
|
43 | {
|
44 | begin: '^ok'
|
45 | },
|
46 | {
|
47 | begin: '^not ok'
|
48 | }
|
49 | ]
|
50 | }
|
51 | ]
|
52 | };
|
53 | }
|
54 |
|
55 | export { tap as default };
|