MCPcopy Create free account
hub / github.com/docker/cli / TestInvalidTopLevelObjectType

Function TestInvalidTopLevelObjectType

cli/compose/loader/loader_test.go:323–332  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

321}
322
323func 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
334func 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.

Callers

nothing calls this directly

Calls 1

loadYAMLFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…