(t *testing.T)
| 239 | } |
| 240 | |
| 241 | func TestStringToSlice(t *testing.T) { |
| 242 | t.Run("comma_separated", func(t *testing.T) { |
| 243 | dst := make([]string, 0) |
| 244 | convertible, err := ConvertString("a,b,c", reflect.ValueOf(&dst)) |
| 245 | expect.True(t, convertible) |
| 246 | expect.NoError(t, err) |
| 247 | expect.Equal(t, dst, []string{"a", "b", "c"}) |
| 248 | }) |
| 249 | t.Run("yaml-like", func(t *testing.T) { |
| 250 | dst := make([]string, 0) |
| 251 | convertible, err := ConvertString("- a\n- b\n- c", reflect.ValueOf(&dst)) |
| 252 | expect.True(t, convertible) |
| 253 | expect.NoError(t, err) |
| 254 | expect.Equal(t, dst, []string{"a", "b", "c"}) |
| 255 | }) |
| 256 | t.Run("single-line-yaml-like", func(t *testing.T) { |
| 257 | dst := make([]string, 0) |
| 258 | convertible, err := ConvertString("- a", reflect.ValueOf(&dst)) |
| 259 | expect.True(t, convertible) |
| 260 | expect.NoError(t, err) |
| 261 | expect.Equal(t, dst, []string{"a"}) |
| 262 | }) |
| 263 | } |
| 264 | |
| 265 | func TestStringToMap(t *testing.T) { |
| 266 | t.Run("yaml-like", func(t *testing.T) { |
nothing calls this directly
no test coverage detected