diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-06 19:49:01 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-06 19:49:01 +0000 |
commit | 0ce10ea1348e9afd5d0eec6bca986bfe58bac5ac (patch) | |
tree | 39530b071991b2326f881b2a30a2d82d6c133fd6 /libgo/go/encoding/xml/xml_test.go | |
parent | 57a8bf1b0c6057ccbacb0cf79eb84d1985c2c1fe (diff) |
libgo: Update to October 24 version of master library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204466 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/encoding/xml/xml_test.go')
-rw-r--r-- | libgo/go/encoding/xml/xml_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libgo/go/encoding/xml/xml_test.go b/libgo/go/encoding/xml/xml_test.go index eeedbe575f8b..7723ab1c9f09 100644 --- a/libgo/go/encoding/xml/xml_test.go +++ b/libgo/go/encoding/xml/xml_test.go @@ -11,6 +11,7 @@ import ( "reflect" "strings" "testing" + "unicode/utf8" ) const testInput = ` @@ -246,10 +247,8 @@ func (d *downCaser) Read(p []byte) (int, error) { } func TestRawTokenAltEncoding(t *testing.T) { - sawEncoding := "" d := NewDecoder(strings.NewReader(testInputAltEncoding)) d.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) { - sawEncoding = charset if charset != "x-testing-uppercase" { t.Fatalf("unexpected charset %q", charset) } @@ -714,3 +713,14 @@ func TestEscapeTextInvalidChar(t *testing.T) { t.Errorf("have %v, want %v", text, expected) } } + +func TestIssue5880(t *testing.T) { + type T []byte + data, err := Marshal(T{192, 168, 0, 1}) + if err != nil { + t.Errorf("Marshal error: %v", err) + } + if !utf8.Valid(data) { + t.Errorf("Marshal generated invalid UTF-8: %x", data) + } +} |