(t *testing.T)
| 412 | } |
| 413 | |
| 414 | func TestUpdateHostsPreservesOrder(t *testing.T) { |
| 415 | flags := newUpdateCommand(nil).Flags() |
| 416 | flags.Set("host-add", "foobar:127.0.0.2") |
| 417 | flags.Set("host-add", "foobar:127.0.0.1") |
| 418 | flags.Set("host-add", "foobar:127.0.0.3") |
| 419 | |
| 420 | hosts := []string{} |
| 421 | err := updateHosts(flags, &hosts) |
| 422 | assert.NilError(t, err) |
| 423 | assert.Check(t, is.DeepEqual([]string{"127.0.0.2 foobar", "127.0.0.1 foobar", "127.0.0.3 foobar"}, hosts)) |
| 424 | } |
| 425 | |
| 426 | func TestUpdateHostsReplaceEntry(t *testing.T) { |
| 427 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…