Merge pull request #31212 from fate-grand-order/fixed

use t.Fatal() to output the err message and fix typo
This commit is contained in:
Akihiro Suda 2017-02-27 12:26:35 +09:00 committed by GitHub
commit 76b6faa13d
1 changed files with 9 additions and 9 deletions

View File

@ -28,7 +28,7 @@ func TestValidateAttach(t *testing.T) {
"STDERR", "STDERR",
} }
if _, err := validateAttach("invalid"); err == nil { if _, err := validateAttach("invalid"); err == nil {
t.Fatalf("Expected error with [valid streams are STDIN, STDOUT and STDERR], got nothing") t.Fatal("Expected error with [valid streams are STDIN, STDOUT and STDERR], got nothing")
} }
for _, attach := range valid { for _, attach := range valid {
@ -96,28 +96,28 @@ func TestParseRunAttach(t *testing.T) {
} }
if _, _, err := parsetest(t, "-a"); err == nil { if _, _, err := parsetest(t, "-a"); err == nil {
t.Fatalf("Error parsing attach flags, `-a` should be an error but is not") t.Fatal("Error parsing attach flags, `-a` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a invalid"); err == nil { if _, _, err := parsetest(t, "-a invalid"); err == nil {
t.Fatalf("Error parsing attach flags, `-a invalid` should be an error but is not") t.Fatal("Error parsing attach flags, `-a invalid` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a invalid -a stdout"); err == nil { if _, _, err := parsetest(t, "-a invalid -a stdout"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -a invalid` should be an error but is not") t.Fatal("Error parsing attach flags, `-a stdout -a invalid` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a stdout -a stderr -d"); err == nil { if _, _, err := parsetest(t, "-a stdout -a stderr -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -a stderr -d` should be an error but is not") t.Fatal("Error parsing attach flags, `-a stdout -a stderr -d` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a stdin -d"); err == nil { if _, _, err := parsetest(t, "-a stdin -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdin -d` should be an error but is not") t.Fatal("Error parsing attach flags, `-a stdin -d` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a stdout -d"); err == nil { if _, _, err := parsetest(t, "-a stdout -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -d` should be an error but is not") t.Fatal("Error parsing attach flags, `-a stdout -d` should be an error but is not")
} }
if _, _, err := parsetest(t, "-a stderr -d"); err == nil { if _, _, err := parsetest(t, "-a stderr -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stderr -d` should be an error but is not") t.Fatal("Error parsing attach flags, `-a stderr -d` should be an error but is not")
} }
if _, _, err := parsetest(t, "-d --rm"); err == nil { if _, _, err := parsetest(t, "-d --rm"); err == nil {
t.Fatalf("Error parsing attach flags, `-d --rm` should be an error but is not") t.Fatal("Error parsing attach flags, `-d --rm` should be an error but is not")
} }
} }