TestPartialInputReader_NonObjectIsIgnored makes sure a streaming payload that doesn't start with { (an array or scalar) does not produce events. Tool inputs are always objects; anything else is almost certainly a bug upstream.
(t *testing.T)
| 142 | // produce events. Tool inputs are always objects; anything else is |
| 143 | // almost certainly a bug upstream. |
| 144 | func TestPartialInputReader_NonObjectIsIgnored(t *testing.T) { |
| 145 | r := NewPartialInputReader() |
| 146 | emits := 0 |
| 147 | r.OnField = func(_ PartialInputField) { emits++ } |
| 148 | r.Feed(`[1,2,3]`) |
| 149 | r.Feed(`"just a string"`) |
| 150 | r.Feed(`42`) |
| 151 | assert.Equal(t, 0, emits) |
| 152 | } |
| 153 | |
| 154 | // TestPartialInputReader_Snapshot lets diagnostics peek at the |
| 155 | // internal buffer without disturbing the streaming state. |
nothing calls this directly
no test coverage detected