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

Function TestBuffer_selectBySearch

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

Source from the content-addressed store, hash-verified

275}
276
277func TestBuffer_selectBySearch(t *testing.T) {
278 type args struct {
279 s string
280 }
281 testBuffer, _ := createNewBufferWithData([][]string{{"a", "b", "c"}, {"1", "2", "3"}, {"4", "1", "6"}}, true)
282 tests := []struct {
283 name string
284 b *Buffer
285 args args
286 want [][]int
287 }{
288 {"Search for '1'", testBuffer, args{s: "1"}, [][]int{{1, 0}, {2, 1}}},
289 }
290 for _, tt := range tests {
291 t.Run(tt.name, func(t *testing.T) {
292 b.selectBySearch(tt.args.s)
293 if got := b.selectedCell; !reflect.DeepEqual(got, tt.want) {
294 t.Errorf("selectBySearch() = %v, want %v", got, tt.want)
295 }
296 })
297 }
298}
299
300// ========================================
301// Buffer Concurrency Tests

Callers

nothing calls this directly

Calls 2

createNewBufferWithDataFunction · 0.85
selectBySearchMethod · 0.80

Tested by

no test coverage detected