diff options
author | Rob Findley <rfindley@google.com> | 2020-09-11 14:23:34 -0400 |
---|---|---|
committer | Rob Findley <rfindley@google.com> | 2020-09-11 14:23:34 -0400 |
commit | f8b1c17aced24a1618c6984794be9770c5d260be (patch) | |
tree | 45af8d39b5c3d9f43d439ebec0a2ba42b49efe70 /src/cmd/link/link_test.go | |
parent | e5d91ab096a9ff9673311f1a7f3f860a7f9c2062 (diff) | |
parent | 07c1788357cfe6a4ee5f6f6a54d4fe9f579fa844 (diff) | |
download | go-dev.types.tar.gz go-dev.types.zip |
[dev.types] all: merge master into dev.typesdev.types
Change-Id: Ia6964cb4e09153c15cc9c5b441373d1b3cb8f757
Diffstat (limited to 'src/cmd/link/link_test.go')
-rw-r--r-- | src/cmd/link/link_test.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 3b5efdf7a3..4e60996d8e 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -1,3 +1,7 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package main import ( @@ -455,9 +459,7 @@ func TestIssue34788Android386TLSSequence(t *testing.T) { cmd := exec.Command(testenv.GoToolPath(t), "tool", "compile", "-o", obj, src) cmd.Env = append(os.Environ(), "GOARCH=386", "GOOS=android") if out, err := cmd.CombinedOutput(); err != nil { - if err != nil { - t.Fatalf("failed to compile blah.go: %v, output: %s\n", err, out) - } + t.Fatalf("failed to compile blah.go: %v, output: %s\n", err, out) } // Run objdump on the resulting object. @@ -798,3 +800,17 @@ func TestContentAddressableSymbols(t *testing.T) { t.Errorf("command %s failed: %v\n%s", cmd, err, out) } } + +func TestReadOnly(t *testing.T) { + // Test that read-only data is indeed read-only. + testenv.MustHaveGoBuild(t) + + t.Parallel() + + src := filepath.Join("testdata", "testRO", "x.go") + cmd := exec.Command(testenv.GoToolPath(t), "run", src) + out, err := cmd.CombinedOutput() + if err == nil { + t.Errorf("running test program did not fail. output:\n%s", out) + } +} |