Commit f8892c1
committed
CLI: Fix TAP compliance for colon in unquoted YAML diag
When an assertion message contained a colon followed by a space,
and otherwise is a single line of ASCII characters, we formatted it
as an unquoted string. This is invalid in YAML 1.2, and thus tap-parser
would ignore the diagnostic block.
This does not affect the TAP result itself (the test name and failure
status are separate from this), and it does not affect the QUnit CLI
output where the information is shown either way.
When passing the CLI output to tap-parser (such as in QTap), it
silently ignored the "diag" block containing the assertion
message/actual/expected value, because it is not valid YAML.
Note that YAML 1.2 does allow literal colons and hash tags in unquoted
strings, when they are not followed by or preceded by a space, but
I'm keeping our version simpler by erring toward quoted strings when
these appear. Just because we could squeeze one more edge case with
plain unquoted strings, doesn't mean we have to. This way keeps our
format a bit more intuitive by making it predictable and easy to
deduce why a string is quoted or not, based solely on the chars used
and not based on obscure YAML internals.
Ref https://yaml.org/spec/1.2.2/#733-plain-style1 parent e114e63 commit f8892c1
File tree
3 files changed
+39
-2
lines changed- src/core/reporters
- test
- cli
- main
3 files changed
+39
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
121 | 155 | | |
122 | 156 | | |
123 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments