aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/encoding/xml/marshal_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/encoding/xml/marshal_test.go')
-rw-r--r--libgo/go/encoding/xml/marshal_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/go/encoding/xml/marshal_test.go b/libgo/go/encoding/xml/marshal_test.go
index 66675d7abc4..ef6c20e949b 100644
--- a/libgo/go/encoding/xml/marshal_test.go
+++ b/libgo/go/encoding/xml/marshal_test.go
@@ -139,6 +139,7 @@ type EmbedA struct {
EmbedC
EmbedB EmbedB
FieldA string
+ embedD
}
type EmbedB struct {
@@ -153,6 +154,11 @@ type EmbedC struct {
FieldC string
}
+type embedD struct {
+ fieldD string
+ FieldE string // Promoted and visible when embedD is embedded.
+}
+
type NameCasing struct {
XMLName struct{} `xml:"casing"`
Xy string
@@ -711,6 +717,9 @@ var marshalTests = []struct {
},
},
FieldA: "A.A",
+ embedD: embedD{
+ FieldE: "A.D.E",
+ },
},
ExpectXML: `<EmbedA>` +
`<FieldB>A.C.B</FieldB>` +
@@ -724,6 +733,7 @@ var marshalTests = []struct {
`<FieldC>A.B.C.C</FieldC>` +
`</EmbedB>` +
`<FieldA>A.A</FieldA>` +
+ `<FieldE>A.D.E</FieldE>` +
`</EmbedA>`,
},