From: Bryan C. Mills Date: Fri, 15 Feb 2019 22:58:21 +0000 (-0500) Subject: cmd/cover: fix TestHtmlUnformatted in module mode X-Git-Tag: go1.13beta1~1450 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b88462ef8b9b0d8613c13deb27ef5f8b72eeab6e;p=gostls13.git cmd/cover: fix TestHtmlUnformatted in module mode Updates #30228 Change-Id: Id9dffa6c805ac630945bac8febe342ce633626c6 Reviewed-on: https://go-review.googlesource.com/c/162830 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index 3de9b0c12d..f002442b63 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -448,6 +448,10 @@ func TestHtmlUnformatted(t *testing.T) { t.Fatal(err) } + if err := ioutil.WriteFile(filepath.Join(htmlUDir, "go.mod"), []byte("module htmlunformatted\n"), 0444); err != nil { + t.Fatal(err) + } + const htmlUContents = ` package htmlunformatted @@ -475,6 +479,7 @@ lab: // testcover -html TMPDIR/htmlunformatted.cov -o unformatted.html cmd = exec.Command(testcover, "-html", htmlUProfile, "-o", htmlUHTML) + cmd.Dir = htmlUDir run(cmd, t) }