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

Function TestBuildInputSchemaRequiredSorting

pkg/workflow/build_input_schema_test.go:160–173  ·  view source on GitHub ↗

TestBuildInputSchemaRequiredSorting tests that required list order is deterministic across multiple runs (callers typically sort the result).

(t *testing.T)

Source from the content-addressed store, hash-verified

158// TestBuildInputSchemaRequiredSorting tests that required list order is deterministic
159// across multiple runs (callers typically sort the result).
160func TestBuildInputSchemaRequiredSorting(t *testing.T) {
161 inputs := map[string]any{
162 "z_param": map[string]any{"type": "string", "required": true},
163 "a_param": map[string]any{"type": "string", "required": true},
164 "m_param": map[string]any{"type": "string", "required": true},
165 }
166
167 for i := range 10 {
168 _, required := buildInputSchema(inputs, defaultDescFn)
169 sort.Strings(required)
170 assert.Equal(t, []string{"a_param", "m_param", "z_param"}, required,
171 "required should be sortable to deterministic order (iteration %d)", i)
172 }
173}
174
175// TestBuildInputSchemaSkipsInvalidDefs tests that non-map input definitions are skipped.
176func TestBuildInputSchemaSkipsInvalidDefs(t *testing.T) {

Callers

nothing calls this directly

Calls 1

buildInputSchemaFunction · 0.85

Tested by

no test coverage detected