split into 3 files by... declaring them all in main
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
use crate::tests as tests_pkg;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_yaml;
|
use serde_yaml;
|
||||||
@@ -70,7 +72,7 @@ mod test_flags {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_flags_files_unhidden_only() {
|
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("plain")).unwrap();
|
||||||
std::fs::File::create(d.path().join(".hidden")).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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::flags as flags_pkg;
|
use crate::flags as flags_pkg;
|
||||||
mod flags;
|
mod flags;
|
||||||
|
mod tests;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let flags = flags_pkg::Flags::new().expect("failed to flags");
|
let flags = flags_pkg::Flags::new().expect("failed to flags");
|
||||||
|
|||||||
3
pttodoest/src/tests.rs
Normal file
3
pttodoest/src/tests.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
pub fn with_dir(mut foo: impl FnMut(tempdir::TempDir)) {
|
||||||
|
foo(tempdir::TempDir::new("").unwrap());
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user