(path: string | undefined, expected: string | RegExp | undefined, message?: string)
| 461 | } |
| 462 | |
| 463 | public assertPath(path: string | undefined, expected: string | RegExp | undefined, message?: string) { |
| 464 | if (!expected || !path) { |
| 465 | assert.equal(path, expected); |
| 466 | } else if (expected instanceof RegExp) { |
| 467 | assert.ok((<RegExp>expected).test(path), message); |
| 468 | } else { |
| 469 | if (DebugClient.CASE_INSENSITIVE_FILESYSTEM) { |
| 470 | if (typeof path === 'string') { |
| 471 | path = path.toLowerCase(); |
| 472 | } |
| 473 | if (typeof expected === 'string') { |
| 474 | expected = (<string>expected).toLowerCase(); |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | // For URIs, use VS Code's toString() to ensure encoding is consistent. |
| 479 | if (typeof path === 'string' && path.includes(":///")) { |
| 480 | path = URI.parse(path).toString(); |
| 481 | } |
| 482 | if (typeof expected === 'string' && expected.includes(":///")) { |
| 483 | expected = URI.parse(expected).toString(); |
| 484 | } |
| 485 | |
| 486 | assert.equal(path, expected, message); |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | // ---- scenarios --------------------------------------------------------------------------------------------------------- |
| 491 |
no test coverage detected