Skip to content

Commit c67b82b

Browse files
committed
Reorder text_nested test to match common order
1 parent 4c8712c commit c67b82b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/serde-de.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,21 @@ mod trivial {
286286
assert_eq!(item, Trivial { value: $expected });
287287
}
288288

289+
#[test]
290+
fn text_nested() {
291+
match from_str::<Trivial<$type>>(&format!(
292+
"<root><nested>{}</nested></root>",
293+
$value
294+
)) {
295+
// Expected unexpected start element `<nested>`
296+
Err(DeError::Custom(reason)) => assert_eq!(reason, "missing field `$text`"),
297+
x => panic!(
298+
r#"Expected `Err(Custom("missing field `$text`"))`, but got `{:?}`"#,
299+
x
300+
),
301+
}
302+
}
303+
289304
#[test]
290305
fn text_tag_after() {
291306
// Unlike `wrapped` test, here we have a struct that is serialized to XML with
@@ -303,21 +318,6 @@ mod trivial {
303318
from_str(&format!("<root><something-else/>{}</root>", $value)).unwrap();
304319
assert_eq!(item, Trivial { value: $expected });
305320
}
306-
307-
#[test]
308-
fn text_nested() {
309-
match from_str::<Trivial<$type>>(&format!(
310-
"<root><nested>{}</nested></root>",
311-
$value
312-
)) {
313-
// Expected unexpected start element `<nested>`
314-
Err(DeError::Custom(reason)) => assert_eq!(reason, "missing field `$text`"),
315-
x => panic!(
316-
r#"Expected `Err(Custom("missing field `$text`"))`, but got `{:?}`"#,
317-
x
318-
),
319-
}
320-
}
321321
}
322322
};
323323
}

0 commit comments

Comments
 (0)