Skip to content

Commit

Permalink
Add roundtrip test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders429 committed Dec 18, 2023
1 parent e5f0b5d commit a3e2538
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/roundtrip.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use claims::{
assert_ok,
assert_ok_eq,
};
use serde::{
Deserialize,
Serialize,
};
use serde_assert::{
Deserializer,
Serializer,
};

#[test]
fn roundtrip() {
let value = true;

let serializer = Serializer::builder().build();
let mut deserializer = Deserializer::builder()
.tokens(assert_ok!(value.serialize(&serializer)))
.build();

assert_ok_eq!(bool::deserialize(&mut deserializer), value);
}

0 comments on commit a3e2538

Please sign in to comment.