From 9ee7a504b42f76fb58c99b1aa94054147bd1fcfb Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Mon, 30 Apr 2018 15:30:22 -0400 Subject: [PATCH] run head in core test with a file that doesn't exist to pass on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/core_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core_test.go b/core/core_test.go index 965972d1..8572d26f 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -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 {