summaryrefslogtreecommitdiff
path: root/src/pkg/xml/marshal_test.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-24 13:23:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-24 13:23:15 +0200
commit0b48c8ae1c27bfcc1f5b3f611e64f47321cd18c6 (patch)
tree107ba5c251175c7ce0d07eeb4748967510c548e2 /src/pkg/xml/marshal_test.go
parent825e92f34920934f09dbf4c614dbd2913ba464cb (diff)
downloadgolang-0b48c8ae1c27bfcc1f5b3f611e64f47321cd18c6.tar.gz
Imported Upstream version 2011.08.17
Diffstat (limited to 'src/pkg/xml/marshal_test.go')
-rw-r--r--src/pkg/xml/marshal_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/xml/marshal_test.go b/src/pkg/xml/marshal_test.go
index 77b2e726d..5b972fafe 100644
--- a/src/pkg/xml/marshal_test.go
+++ b/src/pkg/xml/marshal_test.go
@@ -57,6 +57,11 @@ type Domain struct {
Name []byte `xml:"chardata"`
}
+type Book struct {
+ XMLName Name `xml:"book"`
+ Title string `xml:"chardata"`
+}
+
type SecretAgent struct {
XMLName Name `xml:"agent"`
Handle string `xml:"attr"`
@@ -113,6 +118,7 @@ var marshalTests = []struct {
{Value: &Port{Number: "443"}, ExpectXML: `<port>443</port>`},
{Value: &Port{Type: "<unix>"}, ExpectXML: `<port type="&lt;unix&gt;"></port>`},
{Value: &Domain{Name: []byte("google.com&friends")}, ExpectXML: `<domain>google.com&amp;friends</domain>`},
+ {Value: &Book{Title: "Pride & Prejudice"}, ExpectXML: `<book>Pride &amp; Prejudice</book>`},
{Value: atomValue, ExpectXML: atomXml},
{
Value: &Ship{