MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / TestLogChanWriter_Write

Function TestLogChanWriter_Write

go/executor/executor_test.go:34–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestLogChanWriter_Write(t *testing.T) {
35 a := assert.New(t)
36 rd, wr := pipe.Pipe()
37 go func() {
38 defer wr.Close()
39 cw := &logChanWriter{wr: wr}
40 cw.Write([]byte("hello\n世界"))
41 cw.Write([]byte("hello\n世界"))
42 cw.Write([]byte("\n"))
43 cw.Write([]byte("世界\n世界\n世界\n"))
44 }()
45
46 c := rd.ReadAll()
47
48 a.Equal("hello\n", <-c)
49 a.Equal("世界hello\n", <-c)
50 a.Equal("世界\n", <-c)
51 a.Equal("世界\n", <-c)
52 a.Equal("世界\n", <-c)
53 a.Equal("世界\n", <-c)
54 _, more := <-c
55 a.False(more)
56}

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.95
PipeFunction · 0.92
ReadAllMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected