diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-26 23:57:58 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-26 23:57:58 +0000 |
commit | fa5d125b5cfa5c935e46d27a2cbcd71ae37687ac (patch) | |
tree | 19d182df05ead7ff8ba7ee00a7d57555e1383fdf /libgo/go/xml/read_test.go | |
parent | e3d46e67996cf20ca3a75fccbb5a0007bfa3f992 (diff) | |
download | ppe42-gcc-fa5d125b5cfa5c935e46d27a2cbcd71ae37687ac.tar.gz ppe42-gcc-fa5d125b5cfa5c935e46d27a2cbcd71ae37687ac.zip |
Update Go library to last weekly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/xml/read_test.go')
-rw-r--r-- | libgo/go/xml/read_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libgo/go/xml/read_test.go b/libgo/go/xml/read_test.go index 2126da3c751..d39c2d52a83 100644 --- a/libgo/go/xml/read_test.go +++ b/libgo/go/xml/read_test.go @@ -369,3 +369,25 @@ var attrStruct = AttrTest{ Bool: true, }, } + +// test data for TestUnmarshalWithoutNameType + +const OK = "OK" +const withoutNameTypeData = ` +<?xml version="1.0" charset="utf-8"?> +<Test3 attr="OK" />` + +type TestThree struct { + XMLName bool `xml:"Test3"` // XMLName field without an xml.Name type + Attr string `xml:"attr"` +} + +func TestUnmarshalWithoutNameType(t *testing.T) { + var x TestThree + if err := Unmarshal(StringReader(withoutNameTypeData), &x); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if x.Attr != OK { + t.Fatalf("have %v\nwant %v", x.Attr, OK) + } +} |