summaryrefslogtreecommitdiff
path: root/test/interface/fail.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-09-26 19:35:21 -0400
committerRuss Cox <rsc@golang.org>2011-09-26 19:35:21 -0400
commitca2e62225e091affc59bf49e867438f490fcd839 (patch)
tree5be411aac2e6e2375ca698b6dae5e0eece8709a9 /test/interface/fail.go
parent8f5623ae8618b247a89cfe548fc55ee306105a5a (diff)
downloadgo-ca2e62225e091affc59bf49e867438f490fcd839.tar.gz
test: silence/coalesce some tests
Add copyright notice to nilptr.go. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5139048
Diffstat (limited to 'test/interface/fail.go')
-rw-r--r--test/interface/fail.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/interface/fail.go b/test/interface/fail.go
index 3e741d3f9..0c20bcf75 100644
--- a/test/interface/fail.go
+++ b/test/interface/fail.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ! ./$A.out
+// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -13,6 +13,10 @@ type I interface {
}
func main() {
+ shouldPanic(p1)
+}
+
+func p1() {
var s *S
var i I
var e interface {}
@@ -21,6 +25,14 @@ func main() {
_ = i
}
-// hide S down here to avoid static warning
type S struct {
}
+
+func shouldPanic(f func()) {
+ defer func() {
+ if recover() == nil {
+ panic("function should panic")
+ }
+ }()
+ f()
+}