@@ -55,7 +55,9 @@ describe("wave-23 pitfalls — encoding", () => {
|
55 | 55 | it("P-003 allows whitespace inside predicate values (content)", () => { |
56 | 56 | // Spaces inside a predicate value are legitimate — they're filtering |
57 | 57 | // against actual content. |
58 | | -expect(() => parseOcPath("oc://X/[name=hello world]")).not.toThrow(); |
| 58 | +const path = parseOcPath("oc://X/[name=hello world]"); |
| 59 | +expect(path.file).toBe("X"); |
| 60 | +expect(path.section).toBe("[name=hello world]"); |
59 | 61 | }); |
60 | 62 | |
61 | 63 | it("P-004 / P-011 rejects control characters and null bytes", () => { |
@@ -396,7 +398,7 @@ describe("wave-23 pitfalls — performance & limits", () => {
|
396 | 398 | |
397 | 399 | it("P-032 path at the cap parses cleanly", () => { |
398 | 400 | const justUnder = "oc://X/" + "a".repeat(MAX_PATH_LENGTH - "oc://X/".length); |
399 | | -expect(() => parseOcPath(justUnder)).not.toThrow(); |
| 401 | +expect(parseOcPath(justUnder).section).toBe("a".repeat(MAX_PATH_LENGTH - "oc://X/".length)); |
400 | 402 | }); |
401 | 403 | |
402 | 404 | it("P-032 formatOcPath enforces the same cap on output", () => { |
@@ -477,7 +479,9 @@ describe("wave-23 pitfalls — reserved characters", () => {
|
477 | 479 | // the first `?` as the query split. |
478 | 480 | expect(parseOcPath("oc://X/foo?session=s").section).toBe("foo"); |
479 | 481 | // Empty key after `?` (no `=`): query parser silently ignores. |
480 | | -expect(() => parseOcPath("oc://X/foo?")).not.toThrow(); |
| 482 | +const path = parseOcPath("oc://X/foo?"); |
| 483 | +expect(path.section).toBe("foo"); |
| 484 | +expect(path.session).toBeUndefined(); |
481 | 485 | }); |
482 | 486 | |
483 | 487 | it("P-040 negative-index magnitude is bounded", () => { |
|