(t *testing.T)
| 189 | } |
| 190 | |
| 191 | func TestToInterfaceSlice(t *testing.T) { |
| 192 | scenarios := []struct { |
| 193 | items []string |
| 194 | }{ |
| 195 | {[]string{}}, |
| 196 | {[]string{""}}, |
| 197 | {[]string{"1", "test"}}, |
| 198 | {[]string{"test1", "test1", "test2", "test3"}}, |
| 199 | } |
| 200 | |
| 201 | for i, s := range scenarios { |
| 202 | t.Run(fmt.Sprintf("%d_%#v", i, s.items), func(t *testing.T) { |
| 203 | result := list.ToInterfaceSlice(s.items) |
| 204 | |
| 205 | if len(result) != len(s.items) { |
| 206 | t.Fatalf("Expected length %d, got %d", len(s.items), len(result)) |
| 207 | } |
| 208 | |
| 209 | for j, v := range result { |
| 210 | if v != s.items[j] { |
| 211 | t.Fatalf("Result list item doesn't match with the original list item, got %v VS %v", v, s.items[j]) |
| 212 | } |
| 213 | } |
| 214 | }) |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | func TestNonzeroUniquesString(t *testing.T) { |
| 219 | scenarios := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…