mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:15:59 +00:00
test(managed): align source goldens with metadata validation
Fixes #6650
This commit is contained in:
1 parent
749ae11b15
commit
5a5bcb6b54
3 files changed
+12
-11
No files matched your search
@@ -104,17 +104,12 @@ describe("resolved member signature digests", () => {
|
||||
expect(forged.raw_sha256).toBe(resolved.resolved_sha256);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a TypeSpec, whose blob member inspection does not decode", (1 << 2) | 2],
|
||||
["a TypeRef row outside its table", (9 << 2) | 1],
|
||||
])("does not name %s", (_name, codedIndex) => {
|
||||
const bytes = buildManagedPeFixture({
|
||||
fieldSignature: Buffer.from([0x06, 0x12, codedIndex]),
|
||||
it("decodes a valid but unnamed non-generic TypeSpec operand", () => {
|
||||
const inspection = fieldOf({
|
||||
typeSpecSignatures: [Buffer.from([0x08])],
|
||||
fieldSignature: Buffer.from([0x06, 0x12, (1 << 2) | 2]),
|
||||
});
|
||||
const field = inspectManagedMembersBytes(
|
||||
bytes,
|
||||
managedPeFixtureTarget(bytes),
|
||||
).fields[0];
|
||||
const field = inspection.fields[0];
|
||||
|
||||
expect(field?.signature.parse_status).toBe("decoded");
|
||||
expect(field?.signature.resolved_sha256).toBeNull();
|
||||
@@ -271,6 +266,10 @@ describe("type operand names", () => {
|
||||
fieldSignature: Buffer.from([0x06, 0x12, (9 << 2) | 1]),
|
||||
});
|
||||
|
||||
expect(inspection.fields[0]?.signature.parse_status).toBe("malformed");
|
||||
expect(inspection.fields[0]?.signature.issue).toContain(
|
||||
"coded index selects row 9 in table 1, which has 1 rows",
|
||||
);
|
||||
expect(inspection.fields[0]?.signature.resolved_sha256).toBeNull();
|
||||
expect(inspection.coverage.state).toBe("partial");
|
||||
expect(inspection.coverage.issues).toEqual([
|
||||
|
||||
Reference in new issue
Block a user