run head in core test with a file that doesn't exist to pass on macOS

On a mac, the /proc file system doesn’t exist. To have this test pass,
I’ve written it in a way so that the command will fail like for the ps
command which will allow the test to pass on mac and linux.
This commit is contained in:
Kent Gruber 2018-04-30 15:30:22 -04:00
parent 480f0daa8d
commit 9ee7a504b4

View file

@ -167,7 +167,7 @@ func TestCoreExec(t *testing.T) {
{"foo", []string{}, "", `exec: "foo": executable file not found in $PATH`, `ERROR for 'foo []': exec: "foo": executable file not found in $PATH`},
{"ps", []string{"-someinvalidflag"}, "", "exit status 1", "ERROR for 'ps [-someinvalidflag]': exit status 1"},
{"true", []string{}, "", "", ""},
{"head", []string{"/proc/self/comm"}, "head", "", ""},
{"head", []string{"/path/to/file/that/does/not/exist"}, "", "exit status 1", "ERROR for 'head [/path/to/file/that/does/not/exist]': exit status 1"},
}
for _, u := range units {