Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 429b4da

Browse files
committed
Show expected error in assert_ser_tokens_error
1 parent 381d41a commit 429b4da

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/assert.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ where
128128
{
129129
let mut ser = Serializer::new(tokens);
130130
match value.serialize(&mut ser) {
131-
Ok(_) => panic!("value serialized successfully"),
131+
Ok(_) => assert_eq!(
132+
None,
133+
Some(error),
134+
"value serialized successfully, but error expected (right)"
135+
),
132136
Err(e) => assert_eq!(e, *error),
133137
}
134138

0 commit comments

Comments
 (0)