Skip to content

Commit

Permalink
use pretty assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Nov 1, 2023
1 parent 0e9eadf commit bc23b23
Show file tree
Hide file tree
Showing 44 changed files with 71 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ tonic = { version = "0.8", default-features = false, optional = true }
[dev-dependencies]
bincode = { version = "1.3", default-features = false }
iota-sdk = { version = "1.1", default-features = false, features = [ "std", "serde", "rand" ] }
pretty_assertions = { version = "1.4", default-features = false, features = [ "std" ] }
rand = { version = "0.8", default-features = false, features = [ "std" ] }
ron = { version = "0.8", default-features = false }
yazi = { version = "0.1", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions src/analytics/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ impl CountAndAmount {
mod test {
use std::collections::BTreeMap;

use pretty_assertions::assert_eq;

use super::*;
use crate::{
analytics::{test::TestContext, Analytics},
Expand Down
1 change: 1 addition & 0 deletions src/analytics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ mod test {

use futures::TryStreamExt;
use packable::PackableExt;
use pretty_assertions::assert_eq;
use serde::{de::DeserializeOwned, Deserialize, Serialize};

use super::{
Expand Down
2 changes: 2 additions & 0 deletions src/analytics/tangle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ mod protocol_params;

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::BlockActivityMeasurement;
use crate::{
analytics::{tangle::MilestoneSizeMeasurement, test::TestContext, Analytics},
Expand Down
1 change: 1 addition & 0 deletions src/bin/inx-chronicle/api/explorer/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ impl<B: Send> FromRequest<B> for BlocksByMilestoneIdPagination {
#[cfg(test)]
mod test {
use axum::{extract::RequestParts, http::Request};
use pretty_assertions::assert_eq;

use super::*;
use crate::api::ApiConfig;
Expand Down
1 change: 1 addition & 0 deletions src/bin/inx-chronicle/api/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ mod test {
extract::{FromRequest, RequestParts},
http::Request,
};
use pretty_assertions::assert_eq;

use super::*;
use crate::api::ApiConfig;
Expand Down
1 change: 1 addition & 0 deletions src/bin/inx-chronicle/api/indexer/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ impl<B: Send> FromRequest<B> for IndexedOutputsPagination<NftOutputsQuery> {
#[cfg(test)]
mod test {
use axum::{extract::RequestParts, http::Request};
use pretty_assertions::assert_eq;

use super::*;
use crate::api::ApiConfig;
Expand Down
1 change: 1 addition & 0 deletions src/bin/inx-chronicle/api/poi/merkle_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ mod tests {
use std::str::FromStr;

use chronicle::model::BlockId;
use pretty_assertions::assert_eq;

use super::*;

Expand Down
2 changes: 2 additions & 0 deletions src/bin/inx-chronicle/api/poi/merkle_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ impl TryFrom<HashableDto> for Hashable {
mod tests {
use std::str::FromStr;

use pretty_assertions::assert_eq;

use super::*;

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/db/mongodb/collections/outputs/indexer/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl From<AliasOutputsQuery> for bson::Document {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{self, doc};
use pretty_assertions::assert_eq;
use primitive_types::U256;

use super::AliasOutputsQuery;
Expand Down
1 change: 1 addition & 0 deletions src/db/mongodb/collections/outputs/indexer/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl From<BasicOutputsQuery> for bson::Document {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{self, doc};
use pretty_assertions::assert_eq;
use primitive_types::U256;

use super::BasicOutputsQuery;
Expand Down
1 change: 1 addition & 0 deletions src/db/mongodb/collections/outputs/indexer/foundry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl From<FoundryOutputsQuery> for bson::Document {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{self, doc};
use pretty_assertions::assert_eq;
use primitive_types::U256;

use super::FoundryOutputsQuery;
Expand Down
1 change: 1 addition & 0 deletions src/db/mongodb/collections/outputs/indexer/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl From<NftOutputsQuery> for bson::Document {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{self, doc};
use pretty_assertions::assert_eq;
use primitive_types::U256;

use super::NftOutputsQuery;
Expand Down
1 change: 1 addition & 0 deletions src/inx/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl From<RawMessage<iota_sdk::types::block::payload::Payload>> for proto::RawMi
#[cfg(test)]
mod test {
use iota_sdk::types::block::{payload::Payload, rand::output::rand_output};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
2 changes: 2 additions & 0 deletions src/inx/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ impl From<MilestoneRangeRequest> for proto::MilestoneRangeRequest {

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::*;

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/model/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{doc, from_bson, to_bson, to_document, Bson};
use pretty_assertions::assert_eq;

use super::*;
use crate::model::payload::TransactionEssence;
Expand Down
2 changes: 2 additions & 0 deletions src/model/block/payload/milestone/milestone_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ impl FromStr for MilestoneIndex {

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::*;

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/milestone/milestone_timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl From<MilestoneTimestamp> for influxdb::Timestamp {

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;
use time::macros::datetime;

use super::*;
Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/milestone/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson, Bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{doc, from_bson, to_bson, to_document};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/tagged_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{doc, from_bson, to_bson, to_document};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/address/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/foundry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ mod test {
#[test]
fn test_compute_rent_structure() {
use iota_sdk::types::block::{output::Rent, rand::output};
use pretty_assertions::assert_eq;

use super::RentStructureBytes;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/native_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/output/treasury.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/transaction/unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/block/payload/treasury_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions src/model/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ mod rand {
#[cfg(all(test, feature = "rand"))]
mod test {
use mongodb::bson::{from_bson, to_bson};
use pretty_assertions::assert_eq;

use super::*;

Expand Down
1 change: 1 addition & 0 deletions tests/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod test_rand {
};
use futures::TryStreamExt;
use packable::PackableExt;
use pretty_assertions::assert_eq;
use serde::Deserialize;

#[derive(Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions tests/ledger_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mod test_rand {
};
use futures::TryStreamExt;
use iota_sdk::types::block::rand::number::rand_number_range;
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down
1 change: 1 addition & 0 deletions tests/milestones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod test_rand {
db::mongodb::collections::MilestoneCollection,
model::payload::{MilestoneId, MilestonePayload},
};
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down
1 change: 1 addition & 0 deletions tests/node_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod test_rand {
db::{mongodb::collections::ConfigurationUpdateCollection, MongoDbCollectionExt},
model::{BaseToken, MilestoneKeyRange, NodeConfiguration},
};
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down
1 change: 1 addition & 0 deletions tests/outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod test_rand {
BlockId,
},
};
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down
1 change: 1 addition & 0 deletions tests/protocol_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mod test_rand {
model::{tangle::MilestoneIndex, ProtocolParameters},
};
use iota_sdk::types::block::rand::number::rand_number_range;
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down
1 change: 1 addition & 0 deletions tests/treasury_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mod test_rand {
},
};
use iota_sdk::types::block::rand::number::rand_number_range;
use pretty_assertions::assert_eq;

use super::common::{setup_collection, setup_database, teardown};

Expand Down

0 comments on commit bc23b23

Please sign in to comment.