(t *testing.T)
| 378 | } |
| 379 | |
| 380 | func 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 | |
| 393 | func TestParseHostname(t *testing.T) { |
| 394 | validHostnames := map[string]string{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…