aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-12-21 10:29:21 -0500
committerRuss Cox <rsc@golang.org>2015-12-29 21:16:59 +0000
commit8d5ff2e182c52c4fa6af18e536dcef6e12ad8cb2 (patch)
tree5f5d3338d27a14b5e98af29ccb89d1a390ced3ea /src/runtime/string_test.go
parenta69932051266a817d950996c79927541ebdd26bb (diff)
downloadgo-8d5ff2e182c52c4fa6af18e536dcef6e12ad8cb2.tar.xz
runtime: move test programs out of source code, coalesce
Now there are just three programs to compile instead of many, and repeated tests can reuse the compilation result instead of rebuilding it. Combined, these changes reduce the time spent testing runtime during all.bash on my laptop from about 60 to about 30 seconds. (All.bash itself runs in 5½ minutes.) For #10571. Change-Id: Ie2c1798b847f1a635a860d11dcdab14375319ae9 Reviewed-on: https://go-review.googlesource.com/18085 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/string_test.go')
-rw-r--r--src/runtime/string_test.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/runtime/string_test.go b/src/runtime/string_test.go
index dfda950bdd..318a5532e5 100644
--- a/src/runtime/string_test.go
+++ b/src/runtime/string_test.go
@@ -125,7 +125,7 @@ func TestStringW(t *testing.T) {
}
func TestLargeStringConcat(t *testing.T) {
- output := executeTest(t, largeStringConcatSource, nil)
+ output := runTestProg(t, "testprog", "stringconcat")
want := "panic: " + strings.Repeat("0", 1<<10) + strings.Repeat("1", 1<<10) +
strings.Repeat("2", 1<<10) + strings.Repeat("3", 1<<10)
if !strings.HasPrefix(output, want) {
@@ -133,19 +133,6 @@ func TestLargeStringConcat(t *testing.T) {
}
}
-var largeStringConcatSource = `
-package main
-import "strings"
-func main() {
- s0 := strings.Repeat("0", 1<<10)
- s1 := strings.Repeat("1", 1<<10)
- s2 := strings.Repeat("2", 1<<10)
- s3 := strings.Repeat("3", 1<<10)
- s := s0 + s1 + s2 + s3
- panic(s)
-}
-`
-
func TestGostringnocopy(t *testing.T) {
max := *runtime.Maxstring
b := make([]byte, max+10)