diff --git a/pttodoest/src/flags.rs b/pttodoest/src/flags.rs index d426edc..57a666f 100644 --- a/pttodoest/src/flags.rs +++ b/pttodoest/src/flags.rs @@ -1,3 +1,5 @@ +use crate::tests as tests_pkg; + use clap::Parser; use serde::{Deserialize, Serialize}; use serde_yaml; @@ -70,7 +72,7 @@ mod test_flags { #[test] fn test_flags_files_unhidden_only() { - tests::with_dir(|d| { + tests_pkg::with_dir(|d| { std::fs::File::create(d.path().join("plain")).unwrap(); std::fs::File::create(d.path().join(".hidden")).unwrap(); @@ -86,11 +88,3 @@ mod test_flags { }); } } - -mod tests { - use super::*; - - pub fn with_dir(mut foo: impl FnMut(tempdir::TempDir)) { - foo(tempdir::TempDir::new("").unwrap()); - } -} diff --git a/pttodoest/src/main.rs b/pttodoest/src/main.rs index 54626e7..6547bf1 100755 --- a/pttodoest/src/main.rs +++ b/pttodoest/src/main.rs @@ -1,5 +1,6 @@ use crate::flags as flags_pkg; mod flags; +mod tests; pub fn main() { let flags = flags_pkg::Flags::new().expect("failed to flags"); diff --git a/pttodoest/src/tests.rs b/pttodoest/src/tests.rs new file mode 100644 index 0000000..ff5abf0 --- /dev/null +++ b/pttodoest/src/tests.rs @@ -0,0 +1,3 @@ +pub fn with_dir(mut foo: impl FnMut(tempdir::TempDir)) { + foo(tempdir::TempDir::new("").unwrap()); +}