docs: refresh tool catalog and cleanup audit fixtures

This commit is contained in:
morluto
2026-09-29 11:23:24 +08:00
parent b3aca5289b
commit 53db3a476b
23 changed files with 95 additions and 99 deletions
+22 -21
View File
@@ -4,30 +4,9 @@ import {
categorizeSwiftTypes,
discoverObjcClasses,
discoverObjcProtocols,
discoverSwiftClasses,
} from "./symbolAnalysis.js";
describe("symbol analysis", () => {
it("returns every matching Swift class", () => {
const symbols = Array.from({ length: 120 }, (_, index) => ({
address: `0x${String(index)}`,
name: `_TtCFixture${String(index)}`,
}));
const result = discoverSwiftClasses(symbols, "Fixture");
if (
typeof result === "object" &&
result !== null &&
!Array.isArray(result)
) {
expect(result.count).toBe(120);
expect(result.classes).toHaveLength(120);
expect(Array.isArray(result.classes) ? result.classes[0] : null).toEqual({
address: "0x0",
name: "_TtCFixture0",
});
}
});
it("deduplicates Objective-C classes and protocols by symbol name", () => {
const names = [
{ address: "0x1", name: "_OBJC_CLASS_$_App" },
@@ -79,4 +58,26 @@ describe("symbol analysis", () => {
},
});
});
it("filters Swift categories by a case-sensitive literal name", () => {
const result = categorizeSwiftTypes(
[
{ address: "0x1", name: "_TtCAccount" },
{ address: "0x2", name: "_TtCSession" },
{ address: "0x3", name: "_TtVAccountState" },
],
{ category: "classes", pattern: "Account" },
);
expect(result).toMatchObject({
total: 1,
categories: {
classes: {
count: 1,
items: [{ address: "0x1", name: "_TtCAccount" }],
},
structs: { count: 0, items: [] },
},
});
});
});
+1 -2
View File
@@ -12,14 +12,13 @@ import {
} from "./webContentArtifact.js";
describe("web content artifacts", () => {
it("binds UTF-8 content, size, digest, and URI", () => {
it("binds UTF-8 content, size, and digest inline", () => {
const artifact = createWebTextArtifact(
"const marker = '😀';",
"text/javascript",
);
expect(webTextArtifactSchema.parse(artifact)).toEqual(artifact);
expect(artifact.bytes).toBe(Buffer.byteLength(artifact.text));
expect(artifact.uri).toBe(`rea://web-content/sha256/${artifact.sha256}`);
});
it("rejects altered content that reuses an artifact digest", () => {
File diff suppressed because one or more lines are too long