File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,48 @@ fn issue500() {
241241 ) ;
242242}
243243
244+ /// Regression test for https://github.com/tafia/quick-xml/issues/510.
245+ #[ test]
246+ fn issue510 ( ) {
247+ #[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
248+ #[ serde( rename = "ENTRY" ) ]
249+ struct Entry {
250+ #[ serde( rename = "CUE_V2" ) ]
251+ cues : Option < Vec < Cue > > ,
252+ }
253+
254+ #[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
255+ // #[serde_with::serde_as]
256+ struct Cue {
257+ #[ serde( rename = "@NAME" ) ]
258+ name : String ,
259+ }
260+
261+ let data: Entry = from_str (
262+ "\
263+ <ENTRY>\
264+ <CUE_V2 NAME='foo'></CUE_V2>\
265+ <CUE_V2 NAME='bar'></CUE_V2>\
266+ </ENTRY>\
267+ ",
268+ )
269+ . unwrap ( ) ;
270+
271+ assert_eq ! (
272+ data,
273+ Entry {
274+ cues: Some ( vec![
275+ Cue {
276+ name: "foo" . to_string( ) ,
277+ } ,
278+ Cue {
279+ name: "bar" . to_string( ) ,
280+ } ,
281+ ] ) ,
282+ }
283+ ) ;
284+ }
285+
244286/// Regression test for https://github.com/tafia/quick-xml/issues/537.
245287///
246288/// This test checks that special `xmlns:xxx` attributes uses full name of
You can’t perform that action at this time.
0 commit comments