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

Function Test_getVisCol

io_test.go:279–310  ·  view source on GitHub ↗

======================================== Column Visibility Tests ========================================

(t *testing.T)

Source from the content-addressed store, hash-verified

277// ========================================
278
279func Test_getVisCol(t *testing.T) {
280 type args struct {
281 showNumL []int
282 hideNumL []int
283 colLen int
284 }
285 tests := []struct {
286 name string
287 args args
288 want []int
289 wantErr bool
290 }{
291 {"Set show argument", args{[]int{1, 2, 5}, []int{}, 6}, []int{0, 1, 4}, false},
292 {"Set hide argument", args{[]int{}, []int{1, 2, 5}, 6}, []int{2, 3, 5}, false},
293 {"No arguments set", args{[]int{}, []int{}, 6}, []int{0, 1, 2, 3, 4, 5}, false},
294 {"Both arguments error", args{[]int{1, 2, 3}, []int{1, 2, 3}, 6}, nil, true},
295 {"Show column out of range", args{[]int{1, 2, 3, 7}, []int{}, 6}, nil, true},
296 {"Hide column out of range", args{[]int{}, []int{1, 2, 3, 7}, 6}, nil, true},
297 }
298 for _, tt := range tests {
299 t.Run(tt.name, func(t *testing.T) {
300 got, err := getVisCol(tt.args.showNumL, tt.args.hideNumL, tt.args.colLen)
301 if (err != nil) != tt.wantErr {
302 t.Errorf("getVisCol() error = %v, wantErr %v", err, tt.wantErr)
303 return
304 }
305 if !reflect.DeepEqual(got, tt.want) {
306 t.Errorf("getVisCol() = %v, want %v", got, tt.want)
307 }
308 })
309 }
310}
311
312func Test_checkVisible(t *testing.T) {
313 type args struct {

Callers

nothing calls this directly

Calls 1

getVisColFunction · 0.85

Tested by

no test coverage detected