Skip to content

Commit ddde727

Browse files
saiyam-jain-devSaiyam Jain
andauthored
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 <[email protected]>
1 parent 48c203f commit ddde727

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎docs/erlang-beam.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ nothing, and `fields: []` returns only `source_index`. Offset/limit page matchin
9191
rows in original order (defaults 0/64). Unfiltered pages slice the retained
9292
collection; queries do not decode the file again.
9393

94+
For `chunks`, `names` matches the four-character IFF chunk tag (for example
95+
`"AtU8"`, `"Code"`, `"ExpT"`); available `fields` are `index`, `name`,
96+
`location`, and `payload`. For `lambdas`, `names` matches the resolved function
97+
name from the atom table; `null` names (unresolved atom indices) are never
98+
selected by a name filter. For `atoms`, `names` matches the decoded atom name
99+
string.
100+
94101
`beam` keeps the module, form/Code bounds, original source coverage, and table
95102
counts. A null count means no table was decoded; zero means a decoded empty
96103
table. Missing tables and unresolved atom names remain explicit, and an empty

‎tests/acceptance/applications/erlangBeamViews.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,20 @@ const checkSelectors = async (
7474
{ collection: "lambdas", fields: ["index", "old_unique"] },
7575
[{ source_index: 0, index: 0, old_unique: 42 }],
7676
],
77+
[
78+
{
79+
collection: "lambdas",
80+
names: ["start"],
81+
fields: ["function", "arity", "old_unique"],
82+
},
83+
[{ source_index: 0, function: "start", arity: 1, old_unique: 42 }],
84+
],
85+
[{ collection: "lambdas", names: ["missing"], fields: [] }, []],
7786
[
7887
{ collection: "chunks", names: ["Code"], fields: ["index", "name"] },
7988
[{ source_index: 1, index: 1, name: "Code" }],
8089
],
90+
[{ collection: "chunks", names: ["Xyzz"], fields: [] }, []],
8191
] as const) {
8292
const result = await call("inspect_analysis_view", {
8393
source: { kind: "retained-evidence", evidence_id },

0 commit comments

Comments
 (0)