(t *testing.T)
| 145 | } |
| 146 | |
| 147 | func TestExcludeMapKeys(t *testing.T) { |
| 148 | tests := []struct { |
| 149 | name string |
| 150 | original map[string]any |
| 151 | excludeKeys []string |
| 152 | expected map[string]any |
| 153 | }{ |
| 154 | { |
| 155 | name: "filter single key", |
| 156 | original: map[string]any{ |
| 157 | "key1": "value1", |
| 158 | "key2": "value2", |
| 159 | "key3": "value3", |
| 160 | }, |
| 161 | excludeKeys: []string{"key2"}, |
| 162 | expected: map[string]any{ |
| 163 | "key1": "value1", |
| 164 | "key3": "value3", |
| 165 | }, |
| 166 | }, |
| 167 | { |
| 168 | name: "filter multiple keys", |
| 169 | original: map[string]any{ |
| 170 | "key1": "value1", |
| 171 | "key2": "value2", |
| 172 | "key3": "value3", |
| 173 | "key4": "value4", |
| 174 | }, |
| 175 | excludeKeys: []string{"key1", "key3"}, |
| 176 | expected: map[string]any{ |
| 177 | "key2": "value2", |
| 178 | "key4": "value4", |
| 179 | }, |
| 180 | }, |
| 181 | { |
| 182 | name: "filter no keys", |
| 183 | original: map[string]any{ |
| 184 | "key1": "value1", |
| 185 | "key2": "value2", |
| 186 | }, |
| 187 | excludeKeys: []string{}, |
| 188 | expected: map[string]any{ |
| 189 | "key1": "value1", |
| 190 | "key2": "value2", |
| 191 | }, |
| 192 | }, |
| 193 | { |
| 194 | name: "filter non-existent key", |
| 195 | original: map[string]any{ |
| 196 | "key1": "value1", |
| 197 | "key2": "value2", |
| 198 | }, |
| 199 | excludeKeys: []string{"key3"}, |
| 200 | expected: map[string]any{ |
| 201 | "key1": "value1", |
| 202 | "key2": "value2", |
| 203 | }, |
| 204 | }, |
nothing calls this directly
no test coverage detected