aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/stack_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-01 19:42:22 -0400
committerRuss Cox <rsc@golang.org>2014-09-01 19:42:22 -0400
commita8c5e87b1e5ef224a10440bff6b79b605570cd3c (patch)
tree9986560c32403dfe08eda543f15e04cf2c417cd8 /src/pkg/runtime/stack_test.go
parent548d0805f738c5f4d5bb7e72334b80c2acff059d (diff)
downloadgo-a8c5e87b1e5ef224a10440bff6b79b605570cd3c.tar.xz
runtime: fix Stack
Fixes #8626. LGTM=bradfitz R=golang-codereviews CC=bradfitz, golang-codereviews, iant, r https://golang.org/cl/137050043
Diffstat (limited to 'src/pkg/runtime/stack_test.go')
-rw-r--r--src/pkg/runtime/stack_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pkg/runtime/stack_test.go b/src/pkg/runtime/stack_test.go
index 2877074f76..b3dcbd12a0 100644
--- a/src/pkg/runtime/stack_test.go
+++ b/src/pkg/runtime/stack_test.go
@@ -6,6 +6,7 @@ package runtime_test
import (
. "runtime"
+ "strings"
"sync"
"testing"
"time"
@@ -331,3 +332,12 @@ func TestStackCache(t *testing.T) {
}
}
}
+
+func TestStackOutput(t *testing.T) {
+ b := make([]byte, 1024)
+ stk := string(b[:Stack(b, false)])
+ if !strings.HasPrefix(stk, "goroutine ") {
+ t.Errorf("Stack (len %d):\n%s", len(stk), stk)
+ t.Errorf("Stack output should begin with \"goroutine \"")
+ }
+}