-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1430 from PrismJS/add-tap
Add TAP component
- Loading branch information
Showing
15 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Prism.languages.tap = { | ||
fail: /not ok[^#{\n\r]*/, | ||
pass: /ok[^#{\n\r]*/, | ||
pragma: /pragma [+-][a-z]+/, | ||
bailout: /bail out!.*/i, | ||
version: /TAP version \d+/i, | ||
plan: /\d+\.\.\d+(?: +#.*)?/, | ||
subtest: { | ||
pattern: /# Subtest(?:: .*)?/, | ||
greedy: true | ||
}, | ||
punctuation: /[{}]/, | ||
directive: /#.*/, | ||
yamlish: { | ||
pattern: /(^[^\S\r\n]*)---(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?[^\S\r\n]*\.\.\.$/m, | ||
lookbehind: true, | ||
inside: Prism.languages.yaml, | ||
alias: 'language-yaml' | ||
} | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Bail out! Couldn't connect to database. | ||
bail out! Failed to call API. | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["bailout", "Bail out! Couldn't connect to database."], | ||
["bailout", "bail out! Failed to call API."] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks bail out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ok # SKIP test not written | ||
ok 42 this is the description # TODO write test | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["pass", "ok " ], | ||
["directive", "# SKIP test not written"], | ||
["pass", "ok 42 this is the description "], | ||
["directive", "# TODO write test"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks directives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
not ok | ||
not ok 42 this is the description of the test | ||
ok | ||
ok 42 this is the description of the test | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["fail", "not ok" ], | ||
["fail", "not ok 42 this is the description of the test"], | ||
["pass", "ok" ], | ||
["pass", "ok 42 this is the description of the test"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks test pass & fail together correctly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
1..10 | ||
1..10 # directive | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["plan", "1..10" ], | ||
["plan", "1..10 # directive" ] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks TAP plan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pragma +strict | ||
pragma -strict | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["pragma", "pragma +strict"], | ||
["pragma", "pragma -strict"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks pragma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
TAP version 13 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["version", "TAP version 13" ] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks TAP version |
Oops, something went wrong.