Skip to content

Commit

Permalink
Show expected error in assert_ser_tokens_error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Jul 27, 2023
1 parent 381d41a commit 429b4da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ where
{
let mut ser = Serializer::new(tokens);
match value.serialize(&mut ser) {
Ok(_) => panic!("value serialized successfully"),
Ok(_) => assert_eq!(
None,
Some(error),
"value serialized successfully, but error expected (right)"
),
Err(e) => assert_eq!(e, *error),
}

Expand Down

0 comments on commit 429b4da

Please sign in to comment.