summaryrefslogtreecommitdiff
path: root/src/pkg/xml/xml_test.go
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@gmail.com>2010-01-27 21:13:22 -0800
committerMichael Hoisie <hoisie@gmail.com>2010-01-27 21:13:22 -0800
commit8ea0a18fd136851fa9b1d40d249becbc201785ae (patch)
tree5618e401d9886f916297c3a2dd4bdd815ca1f071 /src/pkg/xml/xml_test.go
parent6cbae1e37303fb14551eb9008de071b2832b8be1 (diff)
downloadgolang-8ea0a18fd136851fa9b1d40d249becbc201785ae.tar.gz
Allow underscores in XML element names (except for leading characters)
Fixes issue 569 R=rsc, r CC=golang-dev http://codereview.appspot.com/194121 Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'src/pkg/xml/xml_test.go')
-rw-r--r--src/pkg/xml/xml_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pkg/xml/xml_test.go b/src/pkg/xml/xml_test.go
index 43d418c1e..f228dfba3 100644
--- a/src/pkg/xml/xml_test.go
+++ b/src/pkg/xml/xml_test.go
@@ -5,6 +5,7 @@
package xml
import (
+ "bytes"
"io"
"os"
"reflect"
@@ -212,3 +213,18 @@ func TestSyntax(t *testing.T) {
}
}
}
+
+type item struct {
+ Field_a string
+}
+
+func TestIssue569(t *testing.T) {
+ data := `<item><field_a>abcd</field_a></item>`
+ var i item
+ buf := bytes.NewBufferString(data)
+ err := Unmarshal(buf, &i)
+
+ if err != nil || i.Field_a != "abcd" {
+ t.Fatalf("Expecting abcd")
+ }
+}