(comments, text)
| 238 | |
| 239 | /* c8 ignore next */ |
| 240 | function assertComments(comments, text) { |
| 241 | for (const comment of comments) { |
| 242 | const commentText = text.slice(locStart(comment), locEnd(comment)); |
| 243 | |
| 244 | if (isLineComment(comment)) { |
| 245 | const openingMark = text.slice( |
| 246 | 0, |
| 247 | text.startsWith("<--") || text.startsWith("-->") ? 3 : 2, |
| 248 | ); |
| 249 | assert.ok(openingMark + comment.value, commentText); |
| 250 | return; |
| 251 | } |
| 252 | |
| 253 | if (isBlockComment(comment)) { |
| 254 | // Flow |
| 255 | const closingMark = commentText.endsWith("*-/") ? "*-/" : "*/"; |
| 256 | assert.equal("/*" + comment.value + closingMark, commentText); |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | throw new Error(`Unknown comment type '${comment.type}'.`); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /* c8 ignore next */ |
| 265 | function assertRaw(node, text) { |
no test coverage detected
searching dependent graphs…