(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func TestFieldSummary_StringAndJSON(t *testing.T) { |
| 115 | cases := []struct { |
| 116 | value FieldSummary |
| 117 | expected string |
| 118 | }{ |
| 119 | {FieldSummaryCount, "count"}, |
| 120 | {FieldSummaryUniqueCount, "uniqueCount"}, |
| 121 | {FieldSummarySum, "sum"}, |
| 122 | {FieldSummaryMin, "min"}, |
| 123 | {FieldSummaryMax, "max"}, |
| 124 | {FieldSummaryMean, "mean"}, |
| 125 | {FieldSummaryMedian, "median"}, |
| 126 | {FieldSummary(250), "count"}, |
| 127 | } |
| 128 | |
| 129 | for _, tc := range cases { |
| 130 | t.Run(tc.expected, func(t *testing.T) { |
| 131 | assert.Equal(t, tc.expected, tc.value.String()) |
| 132 | data, err := json.Marshal(tc.value) |
| 133 | require.NoError(t, err) |
| 134 | assert.Equal(t, `"`+tc.expected+`"`, string(data)) |
| 135 | }) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func TestFieldFilter_StringAndJSON(t *testing.T) { |
| 140 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…