TestBuildInputSchemaRequiredSorting tests that required list order is deterministic across multiple runs (callers typically sort the result).
(t *testing.T)
| 158 | // TestBuildInputSchemaRequiredSorting tests that required list order is deterministic |
| 159 | // across multiple runs (callers typically sort the result). |
| 160 | func 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. |
| 176 | func TestBuildInputSchemaSkipsInvalidDefs(t *testing.T) { |
nothing calls this directly
no test coverage detected