(t *testing.T)
| 424 | } |
| 425 | |
| 426 | func TestUpdateHostsReplaceEntry(t *testing.T) { |
| 427 | flags := newUpdateCommand(nil).Flags() |
| 428 | flags.Set("host-add", "foobar:127.0.0.4") |
| 429 | flags.Set("host-rm", "foobar:127.0.0.2") |
| 430 | |
| 431 | hosts := []string{"127.0.0.2 foobar", "127.0.0.1 foobar", "127.0.0.3 foobar"} |
| 432 | |
| 433 | err := updateHosts(flags, &hosts) |
| 434 | assert.NilError(t, err) |
| 435 | assert.Check(t, is.DeepEqual([]string{"127.0.0.1 foobar", "127.0.0.3 foobar", "127.0.0.4 foobar"}, hosts)) |
| 436 | } |
| 437 | |
| 438 | func TestUpdateHostsRemoveHost(t *testing.T) { |
| 439 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…