(t *testing.T)
| 275 | } |
| 276 | |
| 277 | func 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 |
nothing calls this directly
no test coverage detected