@@ -940,13 +940,13 @@ func TestParseLoggingOpts(t *testing.T) {
940940}
941941
942942func TestParseEnvfileVariables (t * testing.T ) {
943- e := "open nonexistent: no such file or directory"
943+ expErr := "--env-file: open nonexistent: no such file or directory"
944944 if runtime .GOOS == "windows" {
945- e = "open nonexistent: The system cannot find the file specified."
945+ expErr = "--env-file: open nonexistent: The system cannot find the file specified."
946946 }
947947 // env ko
948- if _ , _ , _ , err := parseRun ([]string {"--env-file=nonexistent" , "img" , "cmd" }); err == nil || err .Error () != e {
949- t .Fatalf ("Expected an error with message '%s', got %v" , e , err )
948+ if _ , _ , _ , err := parseRun ([]string {"--env-file=nonexistent" , "img" , "cmd" }); err == nil || err .Error () != expErr {
949+ t .Fatalf ("Expected an error with message '%s', got %v" , expErr , err )
950950 }
951951 // env ok
952952 config , _ , _ , err := parseRun ([]string {"--env-file=testdata/valid.env" , "img" , "cmd" })
@@ -993,13 +993,13 @@ func TestParseEnvfileVariablesWithBOMUnicode(t *testing.T) {
993993}
994994
995995func TestParseLabelfileVariables (t * testing.T ) {
996- e := "open nonexistent: no such file or directory"
996+ expErr := "--label-file: open nonexistent: no such file or directory"
997997 if runtime .GOOS == "windows" {
998- e = "open nonexistent: The system cannot find the file specified."
998+ expErr = "--label-file: open nonexistent: The system cannot find the file specified."
999999 }
10001000 // label ko
1001- if _ , _ , _ , err := parseRun ([]string {"--label-file=nonexistent" , "img" , "cmd" }); err == nil || err .Error () != e {
1002- t .Fatalf ("Expected an error with message '%s', got %v" , e , err )
1001+ if _ , _ , _ , err := parseRun ([]string {"--label-file=nonexistent" , "img" , "cmd" }); err == nil || err .Error () != expErr {
1002+ t .Fatalf ("Expected an error with message '%s', got %v" , expErr , err )
10031003 }
10041004 // label ok
10051005 config , _ , _ , err := parseRun ([]string {"--label-file=testdata/valid.label" , "img" , "cmd" })
0 commit comments