From ddde7276c445fb42ea31952493dacc2a38b7efa0 Mon Sep 17 00:00:00 2001 From: Saiyam Jain <62669344+saiyam-jain-dev@users.noreply.github.com> Date: Sat, 24 Oct 2026 15:09:57 +0530 Subject: [PATCH] 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 --- docs/erlang-beam.md | 7 +++++++ tests/acceptance/applications/erlangBeamViews.test.ts | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/erlang-beam.md b/docs/erlang-beam.md index 0ca020f748..703d2ecf49 100644 --- a/docs/erlang-beam.md +++ b/docs/erlang-beam.md @@ -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 diff --git a/tests/acceptance/applications/erlangBeamViews.test.ts b/tests/acceptance/applications/erlangBeamViews.test.ts index 8eca0f211f..b8778311c3 100644 --- a/tests/acceptance/applications/erlangBeamViews.test.ts +++ b/tests/acceptance/applications/erlangBeamViews.test.ts @@ -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 },