(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func TestBuffer_SortByStr(t *testing.T) { |
| 153 | b := createNewBuffer() |
| 154 | b.rowFreeze = 1 |
| 155 | _ = b.contAppendSli([]string{"Name"}, false) |
| 156 | _ = b.contAppendSli([]string{"Charlie"}, false) |
| 157 | _ = b.contAppendSli([]string{"Alice"}, false) |
| 158 | _ = b.contAppendSli([]string{"Bob"}, false) |
| 159 | |
| 160 | b.sortByStr(0, false) |
| 161 | if b.cont[1][0] != "Alice" { |
| 162 | t.Errorf("After ascending sort, first data row = %s, want Alice", b.cont[1][0]) |
| 163 | } |
| 164 | |
| 165 | b.sortByStr(0, true) |
| 166 | if b.cont[1][0] != "Charlie" { |
| 167 | t.Errorf("After descending sort, first data row = %s, want Charlie", b.cont[1][0]) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestBuffer_sortByNum(t *testing.T) { |
| 172 | type args struct { |
nothing calls this directly
no test coverage detected