MCPcopy Index your code
hub / github.com/docker/cli / TestRunFlagsParseWithMemory

Function TestRunFlagsParseWithMemory

cli/command/container/opts_test.go:370–378  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368}
369
370func TestRunFlagsParseWithMemory(t *testing.T) {
371 flags, _ := setupRunFlags()
372 args := []string{"--memory=invalid", "img", "cmd"}
373 err := flags.Parse(args)
374 assert.ErrorContains(t, err, `invalid argument "invalid" for "-m, --memory" flag`)
375
376 _, hostconfig, _ := mustParse(t, "--memory=1G")
377 assert.Check(t, is.Equal(int64(1073741824), hostconfig.Memory))
378}
379
380func TestParseWithMemorySwap(t *testing.T) {
381 flags, _ := setupRunFlags()

Callers

nothing calls this directly

Calls 2

setupRunFlagsFunction · 0.85
mustParseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…