(t *testing.T)
| 179 | } |
| 180 | |
| 181 | func TestParseDateValueFast(t *testing.T) { |
| 182 | tests := []struct { |
| 183 | name string |
| 184 | input string |
| 185 | shouldBe string // Description of expected behavior |
| 186 | }{ |
| 187 | {"ISO date", "2024-10-17", "non-zero"}, |
| 188 | {"ISO datetime", "2024-10-17 15:30:00", "non-zero"}, |
| 189 | {"US date", "10/17/2024", "non-zero"}, |
| 190 | {"Empty", "", "zero"}, |
| 191 | {"NA", "NA", "zero"}, |
| 192 | {"Invalid", "not a date", "zero"}, |
| 193 | } |
| 194 | |
| 195 | for _, tt := range tests { |
| 196 | t.Run(tt.name, func(t *testing.T) { |
| 197 | result := parseDateValueFast(tt.input) |
| 198 | if tt.shouldBe == "non-zero" && result == 0 { |
| 199 | t.Errorf("parseDateValueFast(%q) = 0, expected non-zero timestamp", tt.input) |
| 200 | } else if tt.shouldBe == "zero" && result != 0 { |
| 201 | t.Errorf("parseDateValueFast(%q) = %d, expected 0", tt.input, result) |
| 202 | } |
| 203 | }) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | func TestSortByNum_Performance(t *testing.T) { |
| 208 | // Create a large dataset to test performance |
nothing calls this directly
no test coverage detected