mirror of
https://github.com/golang/go
synced 2024-11-19 21:14:43 -07:00
html/template: delete panic recovery code from test
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
This commit is contained in:
parent
53d9b6fcf3
commit
7d4ea6cc9e
@ -264,12 +264,6 @@ func TestStringer(t *testing.T) {
|
|||||||
func TestEscapingNilNonemptyInterfaces(t *testing.T) {
|
func TestEscapingNilNonemptyInterfaces(t *testing.T) {
|
||||||
tmpl := Must(New("x").Parse("{{.E}}"))
|
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)
|
got := new(bytes.Buffer)
|
||||||
testData := struct{ E error }{} // any non-empty interface here will do; error is just ready at hand
|
testData := struct{ E error }{} // any non-empty interface here will do; error is just ready at hand
|
||||||
tmpl.Execute(got, testData)
|
tmpl.Execute(got, testData)
|
||||||
|
Loading…
Reference in New Issue
Block a user