File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,35 @@ fn issue343() {
113113 assert_eq ! ( to_string( & users) . unwrap( ) , xml) ;
114114}
115115
116+ /// Regression test for https://github.com/tafia/quick-xml/issues/349.
117+ #[ test]
118+ fn issue349 ( ) {
119+ #[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
120+ struct Entity {
121+ id : Id ,
122+ }
123+ #[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
124+ struct Id {
125+ #[ serde( rename = "$value" ) ]
126+ content : Enum ,
127+ }
128+ #[ derive( Debug , Deserialize , Serialize , PartialEq ) ]
129+ #[ serde( rename_all = "kebab-case" ) ]
130+ enum Enum {
131+ A ( String ) ,
132+ B ( String ) ,
133+ }
134+
135+ assert_eq ! (
136+ from_str:: <Entity >( "<entity><id><a>Id</a></id></entity>" ) . unwrap( ) ,
137+ Entity {
138+ id: Id {
139+ content: Enum :: A ( "Id" . to_string( ) ) ,
140+ }
141+ }
142+ ) ;
143+ }
144+
116145/// Regression test for https://github.com/tafia/quick-xml/issues/537.
117146///
118147/// This test checks that special `xmlns:xxx` attributes uses full name of
You can’t perform that action at this time.
0 commit comments