Test stringSlicesEqual helper
(t *testing.T)
| 559 | |
| 560 | // Test stringSlicesEqual helper |
| 561 | func TestStringSlicesEqual(t *testing.T) { |
| 562 | tests := []struct { |
| 563 | name string |
| 564 | a []string |
| 565 | b []string |
| 566 | expected bool |
| 567 | }{ |
| 568 | {"equal slices", []string{"a", "b", "c"}, []string{"a", "b", "c"}, true}, |
| 569 | {"different length", []string{"a", "b"}, []string{"a", "b", "c"}, false}, |
| 570 | {"different content", []string{"a", "b", "c"}, []string{"a", "b", "d"}, false}, |
| 571 | {"empty slices", []string{}, []string{}, true}, |
| 572 | {"one empty", []string{"a"}, []string{}, false}, |
| 573 | } |
| 574 | |
| 575 | for _, tt := range tests { |
| 576 | t.Run(tt.name, func(t *testing.T) { |
| 577 | result := stringSlicesEqual(tt.a, tt.b) |
| 578 | if result != tt.expected { |
| 579 | t.Errorf("stringSlicesEqual(%v, %v) = %v, want %v", tt.a, tt.b, result, tt.expected) |
| 580 | } |
| 581 | }) |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | // Mock testing.T implementation for testing |
| 586 | type mockTestingT struct { |
nothing calls this directly
no test coverage detected