MCPcopy Create free account
hub / github.com/diillson/chatcli / TestPartialInputReader_IgnoresNonStringFields

Function TestPartialInputReader_IgnoresNonStringFields

llm/partial_input_test.go:67–74  ·  view source on GitHub ↗

TestPartialInputReader_IgnoresNonStringFields documents that numbers, booleans, arrays, and nested objects are skipped — they don't fit the spinner UX and the per-provider streaming code can pull them after the full block lands.

(t *testing.T)

Source from the content-addressed store, hash-verified

65// the spinner UX and the per-provider streaming code can pull them
66// after the full block lands.
67func TestPartialInputReader_IgnoresNonStringFields(t *testing.T) {
68 r := NewPartialInputReader()
69 var seen []string
70 r.OnField = func(f PartialInputField) { seen = append(seen, f.Name) }
71
72 r.Feed(`{"query":"x","max_results":10,"flag":true,"items":[1,2],"nested":{"k":"v"}}`)
73 assert.Equal(t, []string{"query"}, seen)
74}
75
76// TestPartialInputReader_FeedAfterClose is a no-op safety check:
77// after Close, additional fragments are silently dropped rather than

Callers

nothing calls this directly

Calls 3

FeedMethod · 0.95
NewPartialInputReaderFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected