(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestAlphaNumericWithRootTasksFirst_Sort(t *testing.T) { |
| 10 | t.Parallel() |
| 11 | |
| 12 | item1 := "a-item1" |
| 13 | item2 := "m-item2" |
| 14 | item3 := "ns1:item3" |
| 15 | item4 := "ns2:item4" |
| 16 | item5 := "z-item5" |
| 17 | item6 := "ns3:item6" |
| 18 | |
| 19 | tests := []struct { |
| 20 | name string |
| 21 | items []string |
| 22 | want []string |
| 23 | }{ |
| 24 | { |
| 25 | name: "no namespace items sorted alphabetically first", |
| 26 | items: []string{item3, item2, item1}, |
| 27 | want: []string{item1, item2, item3}, |
| 28 | }, |
| 29 | { |
| 30 | name: "namespace items sorted alphabetically after non-namespaced items", |
| 31 | items: []string{item3, item4, item5}, |
| 32 | want: []string{item5, item3, item4}, |
| 33 | }, |
| 34 | { |
| 35 | name: "all items sorted alphabetically with root items first", |
| 36 | items: []string{item6, item5, item4, item3, item2, item1}, |
| 37 | want: []string{item1, item2, item5, item3, item4, item6}, |
| 38 | }, |
| 39 | } |
| 40 | |
| 41 | for _, tt := range tests { |
| 42 | t.Run(tt.name, func(t *testing.T) { |
| 43 | t.Parallel() |
| 44 | |
| 45 | AlphaNumericWithRootTasksFirst(tt.items, nil) |
| 46 | assert.Equal(t, tt.want, tt.items) |
| 47 | }) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func TestAlphaNumeric_Sort(t *testing.T) { |
| 52 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…