summaryrefslogtreecommitdiff
path: root/src/pkg/xml/xml_test.go
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@gmail.com>2010-02-22 15:21:13 -0800
committerMichael Hoisie <hoisie@gmail.com>2010-02-22 15:21:13 -0800
commitec2af12ed506afad3fc31dbe6779892f7ceffff1 (patch)
treef4c27a7222615130c23a16c76c4b7d551377d895 /src/pkg/xml/xml_test.go
parent6cc5955a6b8157188ca66507f8df9a1c2ad0b527 (diff)
downloadgolang-ec2af12ed506afad3fc31dbe6779892f7ceffff1.tar.gz
xml: treat bool as value in Unmarshal
R=rsc CC=golang-dev http://codereview.appspot.com/218050 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/xml/xml_test.go')
-rw-r--r--src/pkg/xml/xml_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pkg/xml/xml_test.go b/src/pkg/xml/xml_test.go
index a4c55b73d..47a3db1e8 100644
--- a/src/pkg/xml/xml_test.go
+++ b/src/pkg/xml/xml_test.go
@@ -215,7 +215,10 @@ func TestSyntax(t *testing.T) {
}
type allScalars struct {
- Bool bool
+ True1 bool
+ True2 bool
+ False1 bool
+ False2 bool
Int int
Int8 int8
Int16 int16
@@ -234,7 +237,10 @@ type allScalars struct {
}
var all = allScalars{
- Bool: true,
+ True1: true,
+ True2: true,
+ False1: false,
+ False2: false,
Int: 1,
Int8: -2,
Int16: 3,
@@ -253,7 +259,10 @@ var all = allScalars{
}
const testScalarsInput = `<allscalars>
- <bool/>
+ <true1>true</true1>
+ <true2>1</true2>
+ <false1>false</false1>
+ <false2>0</false2>
<int>1</int>
<int8>-2</int8>
<int16>3</int16>
@@ -280,7 +289,7 @@ func TestAllScalars(t *testing.T) {
t.Fatal(err)
}
if !reflect.DeepEqual(a, all) {
- t.Errorf("expected %+v got %+v", a, all)
+ t.Errorf("expected %+v got %+v", all, a)
}
}