1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fatal() doesn't take a format string like Fatalf()

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
This commit is contained in:
Kato Kazuyoshi 2014-06-21 17:32:39 +09:00
parent ad19f1beb7
commit 00469957ad

View file

@ -25,26 +25,26 @@ func TestParseLxcConfOpt(t *testing.T) {
func TestNetHostname(t *testing.T) { func TestNetHostname(t *testing.T) {
if _, _, _, err := Parse([]string{"-h=name", "img", "cmd"}, nil); err != nil { if _, _, _, err := Parse([]string{"-h=name", "img", "cmd"}, nil); err != nil {
t.Fatal("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
if _, _, _, err := Parse([]string{"--net=host", "img", "cmd"}, nil); err != nil { if _, _, _, err := Parse([]string{"--net=host", "img", "cmd"}, nil); err != nil {
t.Fatal("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
if _, _, _, err := Parse([]string{"-h=name", "--net=bridge", "img", "cmd"}, nil); err != nil { if _, _, _, err := Parse([]string{"-h=name", "--net=bridge", "img", "cmd"}, nil); err != nil {
t.Fatal("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
if _, _, _, err := Parse([]string{"-h=name", "--net=none", "img", "cmd"}, nil); err != nil { if _, _, _, err := Parse([]string{"-h=name", "--net=none", "img", "cmd"}, nil); err != nil {
t.Fatal("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
if _, _, _, err := Parse([]string{"-h=name", "--net=host", "img", "cmd"}, nil); err != ErrConflictNetworkHostname { if _, _, _, err := Parse([]string{"-h=name", "--net=host", "img", "cmd"}, nil); err != ErrConflictNetworkHostname {
t.Fatal("Expected error ErrConflictNetworkHostname, got: %s", err) t.Fatalf("Expected error ErrConflictNetworkHostname, got: %s", err)
} }
if _, _, _, err := Parse([]string{"-h=name", "--net=container:other", "img", "cmd"}, nil); err != ErrConflictNetworkHostname { if _, _, _, err := Parse([]string{"-h=name", "--net=container:other", "img", "cmd"}, nil); err != ErrConflictNetworkHostname {
t.Fatal("Expected error ErrConflictNetworkHostname, got: %s", err) t.Fatalf("Expected error ErrConflictNetworkHostname, got: %s", err)
} }
} }