MCPcopy Create free account
hub / github.com/github/gh-aw / TestCollectOrTerms_Flat

Function TestCollectOrTerms_Flat

pkg/workflow/expression_optimizer_test.go:1021–1027  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Utility function tests (white-box) ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

1019// ---------------------------------------------------------------------------
1020
1021func TestCollectOrTerms_Flat(t *testing.T) {
1022 // collectOrTerms on a leaf returns just the leaf.
1023 a := cmp(prop("a"), "==", str("1"))
1024 terms := collectOrTerms(a)
1025 require.Len(t, terms, 1, "leaf should produce one term")
1026 assert.Equal(t, "a == '1'", terms[0].Render())
1027}
1028
1029func TestCollectOrTerms_OrNode(t *testing.T) {
1030 // collectOrTerms flattens a two-level OR.

Callers

nothing calls this directly

Calls 5

cmpFunction · 0.85
propFunction · 0.85
strFunction · 0.85
collectOrTermsFunction · 0.85
RenderMethod · 0.65

Tested by

no test coverage detected