diff --git a/Cargo.lock b/Cargo.lock index 3c454db59..4c0d541ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -313,6 +313,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "anyhow" version = "1.0.41" @@ -629,7 +638,7 @@ version = "2.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ - "ansi_term", + "ansi_term 0.11.0", "atty", "bitflags", "strsim", @@ -748,6 +757,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctor" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.14" @@ -772,6 +791,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "diff" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" + [[package]] name = "difference" version = "2.0.0" @@ -1935,6 +1960,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "output_vt100" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "parking_lot" version = "0.11.1" @@ -2152,6 +2186,18 @@ dependencies = [ "treeline", ] +[[package]] +name = "pretty_assertions" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0cfe1b2403f172ba0f234e500906ee0a3e493fb81092dac23ebefe129301cc" +dependencies = [ + "ansi_term 0.12.1", + "ctor", + "diff", + "output_vt100", +] + [[package]] name = "prettytable-rs" version = "0.8.0" @@ -2427,6 +2473,7 @@ dependencies = [ "actix-rt", "actix-web", "anyhow", + "pretty_assertions", "taskchampion", "taskchampion-sync-server", "tempfile", @@ -2916,6 +2963,7 @@ dependencies = [ "anyhow", "chrono", "log", + "pretty_assertions", "proptest", "rstest", "rusqlite", @@ -2948,6 +2996,7 @@ dependencies = [ "mdbook", "nom 6.1.2", "predicates", + "pretty_assertions", "prettytable-rs", "rstest", "serde_json", @@ -2971,6 +3020,7 @@ dependencies = [ "env_logger 0.8.4", "futures", "log", + "pretty_assertions", "rusqlite", "serde", "serde_json", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1bd72c7b6..37fc20b19 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -43,6 +43,7 @@ assert_cmd = "^1.0.3" predicates = "^1.0.7" tempfile = "3" rstest = "0.10" +pretty_assertions = "1" [features] usage-docs = [ "mdbook", "serde_json" ] diff --git a/cli/src/argparse/args/arg_matching.rs b/cli/src/argparse/args/arg_matching.rs index f9582bbbb..a95e4ec1e 100644 --- a/cli/src/argparse/args/arg_matching.rs +++ b/cli/src/argparse/args/arg_matching.rs @@ -43,6 +43,7 @@ where mod test { use super::super::*; use super::*; + use pretty_assertions::assert_eq; #[test] fn test_arg_matching() { diff --git a/cli/src/argparse/args/colon.rs b/cli/src/argparse/args/colon.rs index 3fa17ce97..3fc94c734 100644 --- a/cli/src/argparse/args/colon.rs +++ b/cli/src/argparse/args/colon.rs @@ -51,6 +51,7 @@ pub(crate) fn wait_colon(input: &str) -> IResult<&str, Option>> { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; #[test] fn test_colon_prefix() { diff --git a/cli/src/argparse/args/idlist.rs b/cli/src/argparse/args/idlist.rs index f8c09ae04..095dd1cee 100644 --- a/cli/src/argparse/args/idlist.rs +++ b/cli/src/argparse/args/idlist.rs @@ -75,6 +75,7 @@ pub(crate) fn id_list(input: &str) -> IResult<&str, Vec> { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; #[test] fn test_id_list_single() { diff --git a/cli/src/argparse/args/misc.rs b/cli/src/argparse/args/misc.rs index 27d2a1315..5cb957f10 100644 --- a/cli/src/argparse/args/misc.rs +++ b/cli/src/argparse/args/misc.rs @@ -20,6 +20,7 @@ pub(crate) fn literal(literal: &'static str) -> impl Fn(&str) -> IResult<&str, & mod test { use super::super::*; use super::*; + use pretty_assertions::assert_eq; #[test] fn test_arg_matching() { diff --git a/cli/src/argparse/args/tags.rs b/cli/src/argparse/args/tags.rs index c15dae6bf..1dbea5ee2 100644 --- a/cli/src/argparse/args/tags.rs +++ b/cli/src/argparse/args/tags.rs @@ -15,6 +15,7 @@ pub(crate) fn minus_tag(input: &str) -> IResult<&str, Tag> { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; #[test] fn test_plus_tag() { diff --git a/cli/src/argparse/args/time.rs b/cli/src/argparse/args/time.rs index 47a82e1fc..66c385f85 100644 --- a/cli/src/argparse/args/time.rs +++ b/cli/src/argparse/args/time.rs @@ -160,12 +160,24 @@ fn named_date( "today" => Ok((remaining, local_today)), "tomorrow" => Ok((remaining, local_today + Duration::days(1))), // TODO: lots more! - "eod" => Ok((remaining,local_today + Duration::days(1))), - "sod" => Ok((remaining,local_today)), - "eow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))), - "eoww" => Ok((remaining,local_today + Duration::days((5-day_index).into()))), - "sow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))), - "soww" => Ok((remaining,local_today + Duration::days((7-day_index).into()))), + "eod" => Ok((remaining, local_today + Duration::days(1))), + "sod" => Ok((remaining, local_today)), + "eow" => Ok(( + remaining, + local_today + Duration::days((6 - day_index).into()), + )), + "eoww" => Ok(( + remaining, + local_today + Duration::days((5 - day_index).into()), + )), + "sow" => Ok(( + remaining, + local_today + Duration::days((6 - day_index).into()), + )), + "soww" => Ok(( + remaining, + local_today + Duration::days((7 - day_index).into()), + )), _ => Err(Err::Error(Error::new(input, ErrorKind::Tag))), } .map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc))) @@ -227,6 +239,7 @@ pub(crate) fn timestamp( mod test { use super::*; use crate::argparse::NOW; + use pretty_assertions::assert_eq; use rstest::rstest; const M: i64 = 60; @@ -308,12 +321,12 @@ mod test { #[case::today_from_evening(ldt(2021, 3, 1, 21, 30, 30), "today", ld(2021, 3, 1))] #[case::tomorrow(ld(2021, 3, 1), "tomorrow", ld(2021, 3, 2))] #[case::tomorow_from_evening(ldt(2021, 3, 1, 21, 30, 30), "tomorrow", ld(2021, 3, 2))] - #[case::end_of_week(ld(2021,8,25,), "eow", ld(2021,8,29))] - #[case::end_of_work_week(ld(2021,8,25), "eoww", ld(2021,8,28))] - #[case::start_of_week(ld(2021,8,25), "sow", ld(2021,8,29))] - #[case::start_of_work_week(ld(2021,8,25), "soww", ld(2021,8,30))] - #[case::end_of_today(ld(2021,8,25), "eod", ld(2021,8,26))] - #[case::start_of_today(ld(2021,8,25), "sod", ld(2021,8,25))] + #[case::end_of_week(ld(2021, 8, 25,), "eow", ld(2021, 8, 29))] + #[case::end_of_work_week(ld(2021, 8, 25), "eoww", ld(2021, 8, 28))] + #[case::start_of_week(ld(2021, 8, 25), "sow", ld(2021, 8, 29))] + #[case::start_of_work_week(ld(2021, 8, 25), "soww", ld(2021, 8, 30))] + #[case::end_of_today(ld(2021, 8, 25), "eod", ld(2021, 8, 26))] + #[case::start_of_today(ld(2021, 8, 25), "sod", ld(2021, 8, 25))] fn test_local_timestamp( #[case] now: Box DateTime>, #[values(*IST, *UTC_FO, *HST)] tz: FixedOffset, diff --git a/cli/src/argparse/command.rs b/cli/src/argparse/command.rs index ad7cbd61a..712114f21 100644 --- a/cli/src/argparse/command.rs +++ b/cli/src/argparse/command.rs @@ -58,6 +58,7 @@ impl Command { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; // NOTE: most testing of specific subcommands is handled in `subcommand.rs`. diff --git a/cli/src/argparse/filter.rs b/cli/src/argparse/filter.rs index fa2746bb1..2895c03b7 100644 --- a/cli/src/argparse/filter.rs +++ b/cli/src/argparse/filter.rs @@ -201,6 +201,7 @@ impl Filter { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; #[test] fn test_empty_parse0() { diff --git a/cli/src/argparse/modification.rs b/cli/src/argparse/modification.rs index bd37db928..2005bd2c3 100644 --- a/cli/src/argparse/modification.rs +++ b/cli/src/argparse/modification.rs @@ -165,6 +165,7 @@ impl Modification { mod test { use super::*; use crate::argparse::NOW; + use pretty_assertions::assert_eq; #[test] fn test_empty() { diff --git a/cli/src/argparse/subcommand.rs b/cli/src/argparse/subcommand.rs index 53d67556f..2efc52ea4 100644 --- a/cli/src/argparse/subcommand.rs +++ b/cli/src/argparse/subcommand.rs @@ -411,6 +411,7 @@ impl Sync { mod test { use super::*; use crate::argparse::Condition; + use pretty_assertions::assert_eq; const EMPTY: Vec<&str> = vec![]; diff --git a/cli/src/errors.rs b/cli/src/errors.rs index 16ac96285..6da512136 100644 --- a/cli/src/errors.rs +++ b/cli/src/errors.rs @@ -39,6 +39,7 @@ impl From for Error { mod test { use super::*; use anyhow::anyhow; + use pretty_assertions::assert_eq; #[test] fn test_exit_status() { diff --git a/cli/src/invocation/cmd/add.rs b/cli/src/invocation/cmd/add.rs index abee1bf4d..47df033bc 100644 --- a/cli/src/invocation/cmd/add.rs +++ b/cli/src/invocation/cmd/add.rs @@ -20,6 +20,7 @@ pub(crate) fn execute( mod test { use super::*; use crate::invocation::test::*; + use pretty_assertions::assert_eq; #[test] fn test_add() { diff --git a/cli/src/invocation/cmd/config.rs b/cli/src/invocation/cmd/config.rs index fc8aa6a3f..a3cc9b223 100644 --- a/cli/src/invocation/cmd/config.rs +++ b/cli/src/invocation/cmd/config.rs @@ -34,6 +34,7 @@ pub(crate) fn execute( mod test { use super::*; use crate::invocation::test::*; + use pretty_assertions::assert_eq; use std::fs; use tempfile::TempDir; diff --git a/cli/src/invocation/cmd/gc.rs b/cli/src/invocation/cmd/gc.rs index 9b14b9fbb..f35eaed76 100644 --- a/cli/src/invocation/cmd/gc.rs +++ b/cli/src/invocation/cmd/gc.rs @@ -12,6 +12,7 @@ pub(crate) fn execute(w: &mut W, replica: &mut Replica) -> Result mod test { use super::*; use crate::invocation::test::*; + use pretty_assertions::assert_eq; #[test] fn test_gc() { diff --git a/cli/src/invocation/cmd/info.rs b/cli/src/invocation/cmd/info.rs index c77476a69..58bd46fba 100644 --- a/cli/src/invocation/cmd/info.rs +++ b/cli/src/invocation/cmd/info.rs @@ -50,6 +50,7 @@ pub(crate) fn execute( mod test { use super::*; use crate::invocation::test::*; + use taskchampion::Status; #[test] diff --git a/cli/src/invocation/cmd/modify.rs b/cli/src/invocation/cmd/modify.rs index 0fa803441..3bf7e5b41 100644 --- a/cli/src/invocation/cmd/modify.rs +++ b/cli/src/invocation/cmd/modify.rs @@ -71,6 +71,7 @@ mod test { use crate::argparse::DescriptionMod; use crate::invocation::test::test_replica; use crate::invocation::test::*; + use pretty_assertions::assert_eq; use taskchampion::Status; #[test] diff --git a/cli/src/invocation/cmd/report.rs b/cli/src/invocation/cmd/report.rs index ab079af28..9be4030a7 100644 --- a/cli/src/invocation/cmd/report.rs +++ b/cli/src/invocation/cmd/report.rs @@ -19,6 +19,7 @@ mod test { use super::*; use crate::argparse::Filter; use crate::invocation::test::*; + use taskchampion::Status; #[test] diff --git a/cli/src/invocation/cmd/sync.rs b/cli/src/invocation/cmd/sync.rs index ce213a5ba..b43b01362 100644 --- a/cli/src/invocation/cmd/sync.rs +++ b/cli/src/invocation/cmd/sync.rs @@ -15,6 +15,7 @@ pub(crate) fn execute( mod test { use super::*; use crate::invocation::test::*; + use pretty_assertions::assert_eq; use tempfile::TempDir; #[test] diff --git a/cli/src/invocation/filter.rs b/cli/src/invocation/filter.rs index 0d4add799..6e2378ae4 100644 --- a/cli/src/invocation/filter.rs +++ b/cli/src/invocation/filter.rs @@ -172,6 +172,7 @@ pub(super) fn filtered_tasks( mod test { use super::*; use crate::invocation::test::*; + use pretty_assertions::assert_eq; use taskchampion::Status; #[test] diff --git a/cli/src/invocation/report.rs b/cli/src/invocation/report.rs index d67dae4fb..db20b56ce 100644 --- a/cli/src/invocation/report.rs +++ b/cli/src/invocation/report.rs @@ -133,6 +133,7 @@ mod test { use crate::invocation::test::*; use crate::settings::Sort; use chrono::prelude::*; + use pretty_assertions::assert_eq; use std::convert::TryInto; use taskchampion::{Status, Uuid}; diff --git a/cli/src/settings/report.rs b/cli/src/settings/report.rs index 78650ffe3..88ca1a3cb 100644 --- a/cli/src/settings/report.rs +++ b/cli/src/settings/report.rs @@ -259,6 +259,7 @@ pub(crate) fn get_usage(u: &mut Usage) { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; use taskchampion::Status; use toml::toml; diff --git a/cli/src/settings/settings.rs b/cli/src/settings/settings.rs index e1809091f..7e94a637b 100644 --- a/cli/src/settings/settings.rs +++ b/cli/src/settings/settings.rs @@ -325,6 +325,7 @@ impl Default for Settings { #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; use tempfile::TempDir; use toml::toml; diff --git a/cli/src/settings/util.rs b/cli/src/settings/util.rs index ea585bef2..85d2e1d52 100644 --- a/cli/src/settings/util.rs +++ b/cli/src/settings/util.rs @@ -17,6 +17,7 @@ pub(super) fn table_with_keys<'a>(cfg: &'a toml::Value, keys: &[&str]) -> Result #[cfg(test)] mod test { use super::*; + use pretty_assertions::assert_eq; use toml::toml; #[test] diff --git a/replica-server-tests/Cargo.toml b/replica-server-tests/Cargo.toml index 0287c8d74..1dfb537ce 100644 --- a/replica-server-tests/Cargo.toml +++ b/replica-server-tests/Cargo.toml @@ -16,3 +16,4 @@ anyhow = "1.0" actix-web = "^3.3.2" actix-rt = "^1.1.1" tempfile = "3" +pretty_assertions = "1" diff --git a/replica-server-tests/tests/cross-sync.rs b/replica-server-tests/tests/cross-sync.rs index a828d0f0d..67e02e10c 100644 --- a/replica-server-tests/tests/cross-sync.rs +++ b/replica-server-tests/tests/cross-sync.rs @@ -1,4 +1,5 @@ use actix_web::{App, HttpServer}; +use pretty_assertions::assert_eq; use taskchampion::{Replica, ServerConfig, Status, StorageConfig, Uuid}; use taskchampion_sync_server::{storage::InMemoryStorage, Server}; diff --git a/sync-server/Cargo.toml b/sync-server/Cargo.toml index b26a738d1..c0d26656e 100644 --- a/sync-server/Cargo.toml +++ b/sync-server/Cargo.toml @@ -23,3 +23,4 @@ rusqlite = { version = "0.25", features = ["bundled"] } [dev-dependencies] actix-rt = "^1.1.1" tempfile = "3" +pretty_assertions = "1" diff --git a/sync-server/src/api/add_version.rs b/sync-server/src/api/add_version.rs index 9804258a6..ce9ba1104 100644 --- a/sync-server/src/api/add_version.rs +++ b/sync-server/src/api/add_version.rs @@ -80,6 +80,7 @@ mod test { use crate::storage::{InMemoryStorage, Storage}; use crate::Server; use actix_web::{http::StatusCode, test, App}; + use pretty_assertions::{assert_eq}; use uuid::Uuid; #[actix_rt::test] diff --git a/sync-server/src/api/get_child_version.rs b/sync-server/src/api/get_child_version.rs index d67cde8f2..2b0517145 100644 --- a/sync-server/src/api/get_child_version.rs +++ b/sync-server/src/api/get_child_version.rs @@ -47,6 +47,7 @@ mod test { use crate::storage::{InMemoryStorage, Storage}; use crate::Server; use actix_web::{http::StatusCode, test, App}; + use pretty_assertions::{assert_eq}; use uuid::Uuid; #[actix_rt::test] diff --git a/sync-server/src/bin/taskchampion-sync-server.rs b/sync-server/src/bin/taskchampion-sync-server.rs index 30056351e..aa03cbaf8 100644 --- a/sync-server/src/bin/taskchampion-sync-server.rs +++ b/sync-server/src/bin/taskchampion-sync-server.rs @@ -65,6 +65,7 @@ async fn main() -> anyhow::Result<()> { mod test { use super::*; use actix_web::{test, App}; + use pretty_assertions::{assert_eq}; use taskchampion_sync_server::storage::InMemoryStorage; #[actix_rt::test] diff --git a/sync-server/src/server.rs b/sync-server/src/server.rs index 0fcfb4755..7711c77c0 100644 --- a/sync-server/src/server.rs +++ b/sync-server/src/server.rs @@ -81,6 +81,7 @@ pub(crate) fn add_version<'a>( mod test { use super::*; use crate::storage::{InMemoryStorage, Storage}; + use pretty_assertions::{assert_eq}; #[test] fn gcv_not_found() -> anyhow::Result<()> { diff --git a/sync-server/src/storage/sqlite.rs b/sync-server/src/storage/sqlite.rs index ba56cb0a6..fc4c2dc0f 100644 --- a/sync-server/src/storage/sqlite.rs +++ b/sync-server/src/storage/sqlite.rs @@ -203,6 +203,7 @@ impl StorageTxn for Txn { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; use tempfile::TempDir; #[test] diff --git a/taskchampion/Cargo.toml b/taskchampion/Cargo.toml index 63ddd142f..168d4ba1f 100644 --- a/taskchampion/Cargo.toml +++ b/taskchampion/Cargo.toml @@ -28,3 +28,4 @@ strum_macros = "0.21" proptest = "^1.0.0" tempfile = "3" rstest = "0.10" +pretty_assertions = "1" diff --git a/taskchampion/src/replica.rs b/taskchampion/src/replica.rs index 361476951..75b5137e4 100644 --- a/taskchampion/src/replica.rs +++ b/taskchampion/src/replica.rs @@ -146,6 +146,7 @@ impl Replica { mod tests { use super::*; use crate::task::Status; + use pretty_assertions::{assert_eq}; use uuid::Uuid; #[test] diff --git a/taskchampion/src/server/local.rs b/taskchampion/src/server/local.rs index 657d60881..a9441ac2e 100644 --- a/taskchampion/src/server/local.rs +++ b/taskchampion/src/server/local.rs @@ -159,6 +159,7 @@ impl Server for LocalServer { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; use tempfile::TempDir; #[test] diff --git a/taskchampion/src/server/remote/crypto.rs b/taskchampion/src/server/remote/crypto.rs index a236ef7be..612a0eb28 100644 --- a/taskchampion/src/server/remote/crypto.rs +++ b/taskchampion/src/server/remote/crypto.rs @@ -78,6 +78,7 @@ impl AsRef<[u8]> for HistoryCiphertext { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; #[test] fn round_trip() { diff --git a/taskchampion/src/storage/inmemory.rs b/taskchampion/src/storage/inmemory.rs index e400d61bf..7aa081e57 100644 --- a/taskchampion/src/storage/inmemory.rs +++ b/taskchampion/src/storage/inmemory.rs @@ -166,6 +166,7 @@ impl Storage for InMemoryStorage { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; // (note: this module is heavily used in tests so most of its functionality is well-tested // elsewhere and not tested here) diff --git a/taskchampion/src/storage/operation.rs b/taskchampion/src/storage/operation.rs index ef52f2cb4..7bcf875eb 100644 --- a/taskchampion/src/storage/operation.rs +++ b/taskchampion/src/storage/operation.rs @@ -128,6 +128,7 @@ mod test { use crate::storage::InMemoryStorage; use crate::taskdb::TaskDb; use chrono::{Duration, Utc}; + use pretty_assertions::{assert_eq}; use proptest::prelude::*; // note that `tests/operation_transform_invariant.rs` tests the transform function quite diff --git a/taskchampion/src/storage/sqlite.rs b/taskchampion/src/storage/sqlite.rs index 0e56479fe..759826e4a 100644 --- a/taskchampion/src/storage/sqlite.rs +++ b/taskchampion/src/storage/sqlite.rs @@ -113,9 +113,11 @@ impl<'t> Txn<'t> { fn get_next_working_set_number(&self) -> anyhow::Result { let t = self.get_txn()?; let next_id: Option = t - .query_row("SELECT COALESCE(MAX(id), 0) + 1 FROM working_set", [], |r| { - r.get(0) - }) + .query_row( + "SELECT COALESCE(MAX(id), 0) + 1 FROM working_set", + [], + |r| r.get(0), + ) .optional() .context("Getting highest working set ID")?; @@ -290,7 +292,10 @@ impl<'t> StorageTxn for Txn<'t> { let rows: Vec> = rows.collect(); let mut res = Vec::with_capacity(rows.len()); - for _ in 0..self.get_next_working_set_number().context("Getting working set number")? { + for _ in 0..self + .get_next_working_set_number() + .context("Getting working set number")? + { res.push(None); } for r in rows { @@ -351,6 +356,7 @@ impl<'t> StorageTxn for Txn<'t> { mod test { use super::*; use crate::storage::taskmap_with; + use pretty_assertions::{assert_eq}; use tempfile::TempDir; #[test] diff --git a/taskchampion/src/task/priority.rs b/taskchampion/src/task/priority.rs index 5e3f29d0d..a8ecc98bd 100644 --- a/taskchampion/src/task/priority.rs +++ b/taskchampion/src/task/priority.rs @@ -35,6 +35,7 @@ impl Priority { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; #[test] fn test_priority() { diff --git a/taskchampion/src/task/status.rs b/taskchampion/src/task/status.rs index f9f9fe773..7a14193a7 100644 --- a/taskchampion/src/task/status.rs +++ b/taskchampion/src/task/status.rs @@ -41,6 +41,7 @@ impl Status { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; #[test] fn test_status() { diff --git a/taskchampion/src/task/tag.rs b/taskchampion/src/task/tag.rs index d3a4842e7..123cf3bd7 100644 --- a/taskchampion/src/task/tag.rs +++ b/taskchampion/src/task/tag.rs @@ -138,6 +138,7 @@ pub(super) enum SyntheticTag { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; use rstest::rstest; use std::convert::TryInto; diff --git a/taskchampion/src/task/task.rs b/taskchampion/src/task/task.rs index 40b2d6b0f..bb1002ccd 100644 --- a/taskchampion/src/task/task.rs +++ b/taskchampion/src/task/task.rs @@ -300,6 +300,7 @@ impl<'r> std::ops::Deref for TaskMut<'r> { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; fn with_mut_task(f: F) { let mut replica = Replica::new_inmemory(); diff --git a/taskchampion/src/taskdb.rs b/taskchampion/src/taskdb.rs index b373bc582..7b512b976 100644 --- a/taskchampion/src/taskdb.rs +++ b/taskchampion/src/taskdb.rs @@ -359,6 +359,7 @@ mod tests { use crate::server::test::TestServer; use crate::storage::InMemoryStorage; use chrono::Utc; + use pretty_assertions::{assert_eq}; use proptest::prelude::*; use std::collections::HashMap; use uuid::Uuid; diff --git a/taskchampion/src/utils.rs b/taskchampion/src/utils.rs index 6747b6cbd..7e8dd3867 100644 --- a/taskchampion/src/utils.rs +++ b/taskchampion/src/utils.rs @@ -41,6 +41,7 @@ impl AsRef<[u8]> for Key { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; #[test] fn test_from_bytes() { diff --git a/taskchampion/src/workingset.rs b/taskchampion/src/workingset.rs index 04aa4dcc5..c64c577c9 100644 --- a/taskchampion/src/workingset.rs +++ b/taskchampion/src/workingset.rs @@ -69,6 +69,7 @@ impl WorkingSet { #[cfg(test)] mod test { use super::*; + use pretty_assertions::{assert_eq}; fn make() -> (Uuid, Uuid, WorkingSet) { let uuid1 = Uuid::new_v4();