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

Function TestStreamWriterCRLF

pkg/coder/engine/engine_test.go:131–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

129}
130
131func TestStreamWriterCRLF(t *testing.T) {
132 var lines []string
133 sw := NewStreamWriter(func(line string) {
134 lines = append(lines, line)
135 })
136
137 if _, err := sw.Write([]byte("hello\r\nworld\r\n")); err != nil {
138 t.Fatal(err)
139 }
140 if len(lines) != 2 || lines[0] != "hello" || lines[1] != "world" {
141 t.Errorf("expected [hello, world], got %v", lines)
142 }
143}
144
145func TestEngineExecuteUnknown(t *testing.T) {
146 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
NewStreamWriterFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected