MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / TestBuffer_GetCol

Function TestBuffer_GetCol

buffer_test.go:245–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

243}
244
245func TestBuffer_GetCol(t *testing.T) {
246 b := createNewBuffer()
247 _ = b.contAppendSli([]string{"A", "B", "C"}, false)
248 _ = b.contAppendSli([]string{"1", "2", "3"}, false)
249 _ = b.contAppendSli([]string{"X", "Y", "Z"}, false)
250
251 col := b.getCol(1)
252 expected := []string{"B", "2", "Y"}
253
254 if len(col) != len(expected) {
255 t.Errorf("getCol() returned %d elements, want %d", len(col), len(expected))
256 }
257
258 for i, val := range col {
259 if val != expected[i] {
260 t.Errorf("getCol()[%d] = %s, want %s", i, val, expected[i])
261 }
262 }
263}
264
265func TestBuffer_GetColType(t *testing.T) {
266 b := createNewBuffer()

Callers

nothing calls this directly

Calls 3

createNewBufferFunction · 0.85
contAppendSliMethod · 0.80
getColMethod · 0.80

Tested by

no test coverage detected