We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58a2066 commit 586ff2fCopy full SHA for 586ff2f
generator_test.go
@@ -786,6 +786,30 @@ func TestGenerator(t *testing.T) {
786
"}",
787
),
788
},
789
+ {
790
+ name: "duplicate_elements_and_attributes",
791
+ options: []xmlstruct.GeneratorOption{
792
+ xmlstruct.WithAttrNameSuffix("Attr"),
793
+ xmlstruct.WithImports(false),
794
+ xmlstruct.WithPackageName(""),
795
+ xmlstruct.WithHeader(""),
796
+ },
797
+ xmlStr: joinLines(
798
+ `<a>`,
799
+ ` <b c="1">`,
800
+ ` <c>d</c>`,
801
+ ` </b>`,
802
+ `</a>`,
803
+ ),
804
+ expectedStr: joinLines(
805
+ "type A struct {",
806
+ "\tB struct {",
807
+ "\t\tCAttr int `xml:\"c,attr\"`",
808
+ "\t\tC string `xml:\"c\"`",
809
+ "\t} `xml:\"b\"`",
810
+ "}",
811
812
813
} {
814
t.Run(tc.name, func(t *testing.T) {
815
t.Parallel()
0 commit comments