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

Function TestParseWithMemorySwap

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

Source from the content-addressed store, hash-verified

378}
379
380func TestParseWithMemorySwap(t *testing.T) {
381 flags, _ := setupRunFlags()
382 args := []string{"--memory-swap=invalid", "img", "cmd"}
383 err := flags.Parse(args)
384 assert.ErrorContains(t, err, `invalid argument "invalid" for "--memory-swap" flag`)
385
386 _, hostconfig, _ := mustParse(t, "--memory-swap=1G")
387 assert.Check(t, is.Equal(int64(1073741824), hostconfig.MemorySwap))
388
389 _, hostconfig, _ = mustParse(t, "--memory-swap=-1")
390 assert.Check(t, is.Equal(int64(-1), hostconfig.MemorySwap))
391}
392
393func TestParseHostname(t *testing.T) {
394 validHostnames := map[string]string{

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…