1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:07:56 -07:00

failing test

This commit is contained in:
Julio Capote 2024-10-31 12:21:00 -04:00
parent 6d39245514
commit 58020a2337

View File

@ -4,7 +4,9 @@
package textproto package textproto
import "testing" import (
"testing"
)
type canonicalHeaderKeyTest struct { type canonicalHeaderKeyTest struct {
in, out string in, out string
@ -33,6 +35,17 @@ var canonicalHeaderKeyTests = []canonicalHeaderKeyTest{
{"foo bar", "foo bar"}, {"foo bar", "foo bar"},
} }
func TestNilMapSetOrAdd(t *testing.T) {
defer func() {
if r := recover(); r != nil {
t.Errorf("nil MIMEHeader caused panic: %v", r)
}
}()
var h MIMEHeader
h.Set("foo", "bar")
h.Add("biz", "boo")
}
func TestCanonicalMIMEHeaderKey(t *testing.T) { func TestCanonicalMIMEHeaderKey(t *testing.T) {
for _, tt := range canonicalHeaderKeyTests { for _, tt := range canonicalHeaderKeyTests {
if s := CanonicalMIMEHeaderKey(tt.in); s != tt.out { if s := CanonicalMIMEHeaderKey(tt.in); s != tt.out {