aboutsummaryrefslogtreecommitdiff
path: root/src/testing/sub_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/sub_test.go')
-rw-r--r--src/testing/sub_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go
index 2804550737..2a24aaacfd 100644
--- a/src/testing/sub_test.go
+++ b/src/testing/sub_test.go
@@ -307,6 +307,27 @@ func TestTRun(t *T) {
f: func(t *T) {
t.Skip()
},
+ }, {
+ desc: "panic on goroutine fail after test exit",
+ ok: false,
+ maxPar: 4,
+ f: func(t *T) {
+ ch := make(chan bool)
+ t.Run("", func(t *T) {
+ go func() {
+ <-ch
+ defer func() {
+ if r := recover(); r == nil {
+ realTest.Errorf("expected panic")
+ }
+ ch <- true
+ }()
+ t.Errorf("failed after success")
+ }()
+ })
+ ch <- true
+ <-ch
+ },
}}
for _, tc := range testCases {
ctx := newTestContext(tc.maxPar, newMatcher(regexp.MatchString, "", ""))