diff --git a/decrr_test.go b/decrr_test.go index e3e3b75..51b01cf 100644 --- a/decrr_test.go +++ b/decrr_test.go @@ -3,8 +3,7 @@ package decrr_test import ( "errors" "os" - "os/exec" - "strings" + "runtime" "testing" "github.com/aldy505/decrr" @@ -15,16 +14,11 @@ func TestWrap(t *testing.T) { w := decrr.Wrap(x) wd, _ := os.Getwd() - cmd, err := exec.Command("bash", "-c", "go env | grep GOROOT").CombinedOutput() - if err != nil { - t.Error(err) - } - - gt := strings.Replace(strings.Replace(strings.Replace(string(cmd), "GOROOT=", "", 1), "\"", "", 2), "\n", "", -1) + gt := runtime.GOROOT() var expected string expected += "why does a chicken cross the road?\n\n" - expected += "github.com/aldy505/decrr_test.TestWrap " + wd + "/decrr_test.go:15\n" + expected += "github.com/aldy505/decrr_test.TestWrap " + wd + "/decrr_test.go:14\n" expected += "testing.tRunner " + gt + "/src/testing/testing.go:1259\n" expected += "runtime.goexit " + gt + "/src/runtime/asm_amd64.s:1581"