]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: delete panic recovery code from test
authorRob Pike <r@golang.org>
Sat, 3 Aug 2013 23:06:14 +0000 (09:06 +1000)
committerRob Pike <r@golang.org>
Sat, 3 Aug 2013 23:06:14 +0000 (09:06 +1000)
The test isn't checking deliberate panics so catching them just makes the code longer.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12420043

src/pkg/html/template/content_test.go

index da1eb5c376864c0adea99321988c6044bf7731ed..5e130faacb2063a05f5817f35c72a07c2505b5de 100644 (file)
@@ -264,12 +264,6 @@ func TestStringer(t *testing.T) {
 func TestEscapingNilNonemptyInterfaces(t *testing.T) {
        tmpl := Must(New("x").Parse("{{.E}}"))
 
-       defer func() {
-               if r := recover(); r != nil {
-                       t.Errorf("panic during template execution: %v", r)
-               }
-       }()
-
        got := new(bytes.Buffer)
        testData := struct{ E error }{} // any non-empty interface here will do; error is just ready at hand
        tmpl.Execute(got, testData)