(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestDedicatedColumnsToJson(t *testing.T) { |
| 14 | d := NewDedicatedColumnsToJSON() |
| 15 | |
| 16 | testCols := []backend.DedicatedColumns{} |
| 17 | for i := 0; i < 10; i++ { |
| 18 | testCols = append(testCols, randoDedicatedCols()) |
| 19 | } |
| 20 | |
| 21 | // do all test cols 2x to test caching |
| 22 | for i := 0; i < 2; i++ { |
| 23 | for _, cols := range testCols { |
| 24 | expectedJSON := dedicatedColsToJSON(t, cols) |
| 25 | actualJSON, err := d.JSONForDedicatedColumns(cols) |
| 26 | require.NoError(t, err) |
| 27 | |
| 28 | require.Equal(t, expectedJSON, actualJSON, "iteration %d, cols: %v", i, cols) |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func dedicatedColsToJSON(t *testing.T, cols backend.DedicatedColumns) string { |
| 34 | t.Helper() |
nothing calls this directly
no test coverage detected