Files
reverse-engineering-anything/src/domain/propertyListOpenStepComments.test.ts
T
morluto 5044e20171 test: focus diagnostics and evidence checks on behavior (#9303)
* test: focus configuration diagnostics on their owners

Preserve shape errors, selected paths, recovery guidance, and unchanged-file behavior across parser, setup, and uninstall boundaries.

* test: focus artifact and evidence checks on behavior

Retain format, identity, malformed-input, and cleanup coverage while removing fixed prose and closing the admitted test source.

* refactor(debugger): use configured session admission limits

* test: focus evidence and diagnostics on behavior

* fix(test): restore verifier export and formatting

* test(config): verify debugger limit ranges

* test(rizin): keep fixture executable authoritative

* test(rizin): isolate debugger fixture environment
2026-11-08 16:39:20 +00:00

43 lines
1.3 KiB
TypeScript

import { expect, it } from "vitest";
import { parseXmlPropertyList } from "./propertyListKeys.js";
it("preserves array values and comment-like string content after leading trivia", () => {
const parsed = parseXmlPropertyList(
'\uFEFF /* header */ // array\r\n ("https://example.test", "/*literal*/")',
);
expect(parsed.value).toEqual(["https://example.test", "/*literal*/"]);
expect(parsed.numberLiterals.incomplete).toBe(true);
});
it("preserves own prototype keys through commented OpenStep dispatch", () => {
const parsed = parseXmlPropertyList(
'/* header */ { __proto__ = { secret = value; }; kept = "/*literal*/"; }',
);
expect(parsed.value).toEqual({
["__proto__"]: { secret: "value" },
kept: "/*literal*/",
});
});
it("retains the source depth limit after a leading comment", () => {
expect(() =>
parseXmlPropertyList(`// header\n${"(".repeat(129)}x${")".repeat(129)}`),
).toThrow(/128 nesting levels/iu);
});
it.each(["// header only", "/* unterminated", "/* header */ not-a-container"])(
"does not admit missing or unsupported root values: %s",
(source) => {
expect(() => parseXmlPropertyList(source)).toThrow();
},
);
it("keeps XML comments on the XML decoding path", () => {
expect(
parseXmlPropertyList(
"<!-- header --> <plist><string>value</string></plist>",
).value,
).toBe("value");
});