(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func 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 | |
| 196 | func TestBuffer_SortByNum(t *testing.T) { |
| 197 | b := createNewBuffer() |
nothing calls this directly
no test coverage detected