TestPartialInputReader_MultipleStringFields covers the common shape produced by @coder exec: cmd + cwd in one envelope.
(t *testing.T)
| 52 | // TestPartialInputReader_MultipleStringFields covers the common shape |
| 53 | // produced by @coder exec: cmd + cwd in one envelope. |
| 54 | func TestPartialInputReader_MultipleStringFields(t *testing.T) { |
| 55 | r := NewPartialInputReader() |
| 56 | var names []string |
| 57 | r.OnField = func(f PartialInputField) { names = append(names, f.Name) } |
| 58 | |
| 59 | r.Feed(`{"cmd":"ls","cwd":"/tmp"}`) |
| 60 | assert.ElementsMatch(t, []string{"cmd", "cwd"}, names) |
| 61 | } |
| 62 | |
| 63 | // TestPartialInputReader_IgnoresNonStringFields documents that numbers, |
| 64 | // booleans, arrays, and nested objects are skipped — they don't fit |
nothing calls this directly
no test coverage detected