MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / assertPath

Method assertPath

src/test/debug_client_ms.ts:463–488  ·  view source on GitHub ↗
(path: string | undefined, expected: string | RegExp | undefined, message?: string)

Source from the content-addressed store, hash-verified

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

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected