(t *testing.T)
| 321 | } |
| 322 | |
| 323 | func TestInvalidTopLevelObjectType(t *testing.T) { |
| 324 | _, err := loadYAML("1") |
| 325 | assert.Check(t, is.ErrorContains(err, "top-level object must be a mapping")) |
| 326 | |
| 327 | _, err = loadYAML(`"hello"`) |
| 328 | assert.Check(t, is.ErrorContains(err, "top-level object must be a mapping")) |
| 329 | |
| 330 | _, err = loadYAML(`["hello"]`) |
| 331 | assert.Check(t, is.ErrorContains(err, "top-level object must be a mapping")) |
| 332 | } |
| 333 | |
| 334 | func TestNonStringKeys(t *testing.T) { |
| 335 | // FIXME(thaJeztah): opkg.in/yaml.v3, which always unmarshals to a map[string]any, so we cannot produce a customized error for invalid types. |
nothing calls this directly
no test coverage detected
searching dependent graphs…