Skip to content

Commit

Permalink
Check that round-tripped data is equal in tests (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinji authored Mar 6, 2023
1 parent 289b6ba commit 3d8c2ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/497-check-serde-eq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- In `test_serialization_roundtrip`, check that round-tripped data is equal
([#497](https://github.com/cosmos/ibc-rs/issues/497))
6 changes: 3 additions & 3 deletions crates/ibc/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::{de::DeserializeOwned, Serialize};
#[cfg(feature = "serde")]
pub fn test_serialization_roundtrip<T>(json_data: &str)
where
T: core::fmt::Debug + Serialize + DeserializeOwned,
T: core::fmt::Debug + PartialEq + Serialize + DeserializeOwned,
{
let parsed0 = serde_json::from_str::<T>(json_data);
assert!(parsed0.is_ok());
Expand All @@ -22,7 +22,7 @@ where

let parsed1 = serde_json::from_str::<T>(&serialized);
assert!(parsed1.is_ok());
let parsed1 = parsed1.unwrap();

// TODO - fix PartialEq bound issue in AbciQuery
//assert_eq!(parsed0, parsed1);
assert_eq!(parsed0, parsed1);
}

0 comments on commit 3d8c2ef

Please sign in to comment.