mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
test(ghidra): expect malformed language XML as a malformed ParseFailure (#11234)
This commit is contained in:
1 parent
e0f433ff1b
commit
90e192240a
1 file changed
+4
-6
@@ -31,17 +31,17 @@ it.each([
|
||||
'"><language id="toy:LE:32:default"/></language_definitions>',
|
||||
),
|
||||
]),
|
||||
expectedError: "invalid-bytes",
|
||||
expectedError: { reason: "invalid-bytes" },
|
||||
},
|
||||
{
|
||||
name: "encoding mismatch",
|
||||
bytes: Buffer.from('<?xml version="1.0" encoding="UTF-16"?>' + xml),
|
||||
expectedError: "encoding-mismatch",
|
||||
expectedError: { reason: "encoding-mismatch" },
|
||||
},
|
||||
{
|
||||
name: "malformed XML alongside U+FFFD",
|
||||
bytes: Buffer.from(xml.replace('id="toy:LE:32:default"', "id=unquoted")),
|
||||
expectedError: "malformed",
|
||||
expectedError: { _tag: "ParseFailureError", kind: "malformed" },
|
||||
},
|
||||
])(
|
||||
"reads $name at the language-file byte boundary",
|
||||
@@ -64,8 +64,6 @@ it.each([
|
||||
else
|
||||
await expect(
|
||||
readGhidraLanguageCatalog(root, new ArtifactResourceScope()),
|
||||
).rejects.toMatchObject({
|
||||
reason: expectedError,
|
||||
});
|
||||
).rejects.toMatchObject(expectedError);
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user