add failing test for nil-struct
Ilia Choly
5 years ago
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
142 | const structEmptyXML = ` | |
143 | <value> | |
144 | <struct> | |
145 | </struct> | |
146 | </value> | |
147 | ` | |
148 | ||
149 | func Test_unmarshalEmptyStruct(t *testing.T) { | |
150 | var v interface{} | |
151 | if err := unmarshal([]byte(structEmptyXML), &v); err != nil { | |
152 | t.Fatal(err) | |
153 | } | |
154 | if v == nil { | |
155 | t.Fatalf("got nil map") | |
156 | } | |
157 | } | |
158 | ||
142 | 159 | const arrayValueXML = ` |
143 | 160 | <value> |
144 | 161 | <array> |