From 33b4762d5c161abf93d53d656d3e74eff5a3a9bb Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:13:54 +0800 Subject: [PATCH] test: prune redundant native parser assertions --- src/native/AppleDispatchMetadata.test.ts | 5 +++-- src/native/parsers/plist.test.ts | 12 ------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/native/AppleDispatchMetadata.test.ts b/src/native/AppleDispatchMetadata.test.ts index 4e357503d8..032cfca327 100644 --- a/src/native/AppleDispatchMetadata.test.ts +++ b/src/native/AppleDispatchMetadata.test.ts @@ -1466,8 +1466,9 @@ describe("Objective-C category class references without a class name", () => { bytes.writeUInt32LE(bindings.length, 284); expect(categoryCoverage(bytes)).toMatchObject({ status: "partial", - reason: - "category_class_unresolved at 0x100000b48: Category FixtureCategory class reference is bound to _$s4Main3FooCN, which is not read as an Objective-C class name", + reason: expect.stringMatching( + /category_class_unresolved.*0x100000b48.*FixtureCategory.*_\$s4Main3FooCN.*not read as an Objective-C class name/iu, + ), }); }); diff --git a/src/native/parsers/plist.test.ts b/src/native/parsers/plist.test.ts index 37eb125a86..eda100fcdd 100644 --- a/src/native/parsers/plist.test.ts +++ b/src/native/parsers/plist.test.ts @@ -32,7 +32,6 @@ it("retains binary dictionary identity after native plist number projection", () const result = parsePlistBinary( Buffer.from(buildBinary({ nested: { CF$UID: 7 }, reference: { UID: 7 } })), ); - expect(result.ok).toBe(true); if (!result.ok) throw result.error; const value = result.value.value as Record; expect(value).toEqual({ nested: { CF$UID: 7 }, reference: { UID: 7 } }); @@ -50,7 +49,6 @@ it("projects wide integers in binary CF$UID dictionaries as data", () => { const result = parsePlistBinary( binaryPlistObjectTable(bytes, [8, 11, 18], 27), ); - expect(result.ok).toBe(true); if (!result.ok) throw result.error; expect(result.value.value).toEqual({ CF$UID: { $plist_type: "integer", decimal: "9007199254740993" }, @@ -141,7 +139,6 @@ it.each(["", "AAE="])( const parseWithoutMutatingSource = (bytes: Buffer) => { const original = Buffer.from(bytes); const parsed = parsePlistBinary(bytes); - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(Buffer.compare(bytes, original)).toBe(0); return parsed.value; @@ -394,8 +391,6 @@ it("rejects a reachable date with a malformed marker", () => { it("does not reject an unreachable malformed date object as a decoded value", () => { const parsed = parsePlistBinary(binaryWithUnreachableMalformedDate()); - - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(parsed.value.value).toBe("ok"); expect(parsed.value.limitations).toContainEqual( @@ -405,8 +400,6 @@ it("does not reject an unreachable malformed date object as a decoded value", () it("keeps reachable date uncertainty when another object is malformed", () => { const parsed = parsePlistBinary(binaryWithReachableAndUnreachableDate()); - - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(parsed.value.value).toEqual([{ $plist_type: "date", iso8601: null }]); expect(parsed.value.limitations).toContainEqual( @@ -422,7 +415,6 @@ it("retains reachable date source facts when an unreachable offset is invalid", expect(metadata.dates).toHaveLength(1); expect(metadata.dates[0]?.secondsSince2001).toBe(0.1005); - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(parsed.value.value).toEqual([{ $plist_type: "date", iso8601: null }]); expect(parsed.value.limitations).toContainEqual( @@ -447,8 +439,6 @@ it("does not rewrite shared bytes when a reachable date overlaps another object" it("keeps an exactly millisecond-representable overlapping date known", () => { const parsed = parsePlistBinary(binaryWithExactOverlappingDateAndNull()); - - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(parsed.value.value).toEqual([ { $plist_type: "date", iso8601: "2001-01-01T00:00:00.000Z" }, @@ -478,8 +468,6 @@ it("keeps a date unknown when its start is inside another reachable payload", () it("isolates an overlapping date without losing an independent date", () => { const parsed = parsePlistBinary(binaryWithOverlappingAndIndependentDates()); - - expect(parsed.ok).toBe(true); if (!parsed.ok) throw parsed.error; expect(parsed.value.value).toEqual([ { $plist_type: "data", base64: "ADM/ubpeNT987g==" },