(t *testing.T)
| 381 | } |
| 382 | |
| 383 | func TestLoadMergeYamlJson(t *testing.T) { |
| 384 | var ( |
| 385 | assert = assert.New(t) |
| 386 | k = koanf.New(delim) |
| 387 | ) |
| 388 | |
| 389 | assert.NoError(k.Load(file.Provider(mockYAML), yaml.Parser()), |
| 390 | "error loading file") |
| 391 | // loading json after yaml causes the intbools to be loaded as []float64 |
| 392 | assert.NoError(k.Load(file.Provider(mockJSON), yaml.Parser()), |
| 393 | "error loading file") |
| 394 | |
| 395 | // checking that there is no issues with expecting it to be an []int64 |
| 396 | v := k.Int64s("intbools") |
| 397 | assert.Len(v, 3) |
| 398 | |
| 399 | defer func() { |
| 400 | if err := recover(); err != nil { |
| 401 | assert.Failf("panic", "received panic: %v", err) |
| 402 | } |
| 403 | }() |
| 404 | |
| 405 | v2 := k.MustInt64s("intbools") |
| 406 | assert.Len(v2, 3) |
| 407 | } |
| 408 | |
| 409 | func TestLoadMergeJsonYaml(t *testing.T) { |
| 410 | var ( |
nothing calls this directly
no test coverage detected
searching dependent graphs…