(t *testing.T)
| 330 | } |
| 331 | |
| 332 | func TestSingleSelectOptionsEqual(t *testing.T) { |
| 333 | tests := []struct { |
| 334 | name string |
| 335 | a []singleSelectOption |
| 336 | b []singleSelectOption |
| 337 | expected bool |
| 338 | }{ |
| 339 | { |
| 340 | name: "equal options", |
| 341 | a: []singleSelectOption{ |
| 342 | {Name: "Option 1", Color: "RED"}, |
| 343 | {Name: "Option 2", Color: "BLUE"}, |
| 344 | }, |
| 345 | b: []singleSelectOption{ |
| 346 | {Name: "Option 1", Color: "RED"}, |
| 347 | {Name: "Option 2", Color: "BLUE"}, |
| 348 | }, |
| 349 | expected: true, |
| 350 | }, |
| 351 | { |
| 352 | name: "different lengths", |
| 353 | a: []singleSelectOption{ |
| 354 | {Name: "Option 1", Color: "RED"}, |
| 355 | }, |
| 356 | b: []singleSelectOption{ |
| 357 | {Name: "Option 1", Color: "RED"}, |
| 358 | {Name: "Option 2", Color: "BLUE"}, |
| 359 | }, |
| 360 | expected: false, |
| 361 | }, |
| 362 | { |
| 363 | name: "different order", |
| 364 | a: []singleSelectOption{ |
| 365 | {Name: "Option 1", Color: "RED"}, |
| 366 | {Name: "Option 2", Color: "BLUE"}, |
| 367 | }, |
| 368 | b: []singleSelectOption{ |
| 369 | {Name: "Option 2", Color: "BLUE"}, |
| 370 | {Name: "Option 1", Color: "RED"}, |
| 371 | }, |
| 372 | expected: false, |
| 373 | }, |
| 374 | { |
| 375 | name: "both empty", |
| 376 | a: []singleSelectOption{}, |
| 377 | b: []singleSelectOption{}, |
| 378 | expected: true, |
| 379 | }, |
| 380 | } |
| 381 | |
| 382 | for _, tt := range tests { |
| 383 | t.Run(tt.name, func(t *testing.T) { |
| 384 | result := singleSelectOptionsEqual(tt.a, tt.b) |
| 385 | assert.Equal(t, tt.expected, result, "Equality check should match expectation") |
| 386 | }) |
| 387 | } |
| 388 | } |
| 389 |
nothing calls this directly
no test coverage detected