(t *testing.T)
| 299 | } |
| 300 | |
| 301 | func TestMergeUnique(t *testing.T) { |
| 302 | tests := []struct { |
| 303 | name string |
| 304 | base []string |
| 305 | extra []string |
| 306 | expected []string |
| 307 | }{ |
| 308 | { |
| 309 | name: "deduplicates base and extra preserving first seen order", |
| 310 | base: []string{"a", "b", "a"}, |
| 311 | extra: []string{"b", "c", "a", "d"}, |
| 312 | expected: []string{"a", "b", "c", "d"}, |
| 313 | }, |
| 314 | { |
| 315 | name: "nil base with extra values", |
| 316 | base: nil, |
| 317 | extra: []string{"x", "x", "y"}, |
| 318 | expected: []string{"x", "y"}, |
| 319 | }, |
| 320 | } |
| 321 | |
| 322 | for _, tt := range tests { |
| 323 | t.Run(tt.name, func(t *testing.T) { |
| 324 | result := MergeUnique(tt.base, tt.extra...) |
| 325 | assert.Equal(t, tt.expected, result, "MergeUnique should return deduplicated merged slice") |
| 326 | }) |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | func TestExclude(t *testing.T) { |
| 331 | tests := []struct { |
nothing calls this directly
no test coverage detected