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

Function TestBuffer_sortByNum

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

Source from the content-addressed store, hash-verified

169}
170
171func TestBuffer_sortByNum(t *testing.T) {
172 type args struct {
173 colIndex int
174 rev bool
175 }
176 testBuffer, _ := createNewBufferWithData([][]string{{"a", "b", "c"}, {"5", "2", "3"}, {"4", "5", "6"}, {"10", "8", "9"}}, true)
177 wantBuffer, _ := createNewBufferWithData([][]string{{"a", "b", "c"}, {"4", "5", "6"}, {"5", "2", "3"}, {"10", "8", "9"}}, true)
178 tests := []struct {
179 name string
180 b *Buffer
181 args args
182 want *Buffer
183 }{
184 {"Number sort ascending", testBuffer, args{colIndex: 0, rev: false}, wantBuffer},
185 }
186 for _, tt := range tests {
187 t.Run(tt.name, func(t *testing.T) {
188 tt.b.sortByNum(tt.args.colIndex, tt.args.rev)
189 if !reflect.DeepEqual(tt.b, tt.want) {
190 t.Errorf("Buffer_sortByNum() = %v, want %v", tt.b, tt.want)
191 }
192 })
193 }
194}
195
196func TestBuffer_SortByNum(t *testing.T) {
197 b := createNewBuffer()

Callers

nothing calls this directly

Calls 2

createNewBufferWithDataFunction · 0.85
sortByNumMethod · 0.80

Tested by

no test coverage detected