(t *testing.T)
| 436 | } |
| 437 | |
| 438 | func TestUpdateHostsRemoveHost(t *testing.T) { |
| 439 | flags := newUpdateCommand(nil).Flags() |
| 440 | flags.Set("host-rm", "host1") |
| 441 | |
| 442 | hosts := []string{"127.0.0.2 host3 host1 host2 host4", "127.0.0.1 host1 host4", "127.0.0.3 host1"} |
| 443 | |
| 444 | err := updateHosts(flags, &hosts) |
| 445 | assert.NilError(t, err) |
| 446 | |
| 447 | // Removing host `host1` should remove the entry from each line it appears in. |
| 448 | // If there are no other hosts in the entry, the entry itself should be removed. |
| 449 | assert.Check(t, is.DeepEqual([]string{"127.0.0.2 host3 host2 host4", "127.0.0.1 host4"}, hosts)) |
| 450 | } |
| 451 | |
| 452 | func TestUpdateHostsRemoveHostIP(t *testing.T) { |
| 453 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…