test(erlang): cover lambdas names filter and chunks miss in BEAM views (#6973)

Add lambdas names-filter selector cases to checkSelectors:
- names: ['start'] returns the matching lambda with resolved fields
- names: ['missing'] returns an empty page

Add a chunks no-match case:
- names: ['Xyzz'] returns an empty page for an absent chunk tag

Also clarify in docs/erlang-beam.md what names selects for each
collection: the four-character IFF tag for chunks, the resolved
function name (never null) for lambdas, and the decoded atom name
string for atoms.

Co-authored-by: Saiyam Jain <saiyam@example.com>
This commit is contained in:
Saiyam JainandSaiyam Jain authored and GitHub committed 2026-10-24 17:39:57 +08:00
1 parent 48c203f356
commit ddde7276c4
2 files changed
+17

No files matched your search

+7
View File
@@ -91,6 +91,13 @@ nothing, and `fields: []` returns only `source_index`. Offset/limit page matchin
rows in original order (defaults 0/64). Unfiltered pages slice the retained
collection; queries do not decode the file again.
For `chunks`, `names` matches the four-character IFF chunk tag (for example
`"AtU8"`, `"Code"`, `"ExpT"`); available `fields` are `index`, `name`,
`location`, and `payload`. For `lambdas`, `names` matches the resolved function
name from the atom table; `null` names (unresolved atom indices) are never
selected by a name filter. For `atoms`, `names` matches the decoded atom name
string.
`beam` keeps the module, form/Code bounds, original source coverage, and table
counts. A null count means no table was decoded; zero means a decoded empty
table. Missing tables and unresolved atom names remain explicit, and an empty
@@ -74,10 +74,20 @@ const checkSelectors = async (
{ collection: "lambdas", fields: ["index", "old_unique"] },
[{ source_index: 0, index: 0, old_unique: 42 }],
],
[
{
collection: "lambdas",
names: ["start"],
fields: ["function", "arity", "old_unique"],
},
[{ source_index: 0, function: "start", arity: 1, old_unique: 42 }],
],
[{ collection: "lambdas", names: ["missing"], fields: [] }, []],
[
{ collection: "chunks", names: ["Code"], fields: ["index", "name"] },
[{ source_index: 1, index: 1, name: "Code" }],
],
[{ collection: "chunks", names: ["Xyzz"], fields: [] }, []],
] as const) {
const result = await call("inspect_analysis_view", {
source: { kind: "retained-evidence", evidence_id },