You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.0 KiB
57 lines
1.0 KiB
#![allow(dead_code)]
|
|
|
|
pub const BUFFER_SIZE: usize = 4096;
|
|
|
|
mod bytes;
|
|
mod error;
|
|
mod hash;
|
|
mod container;
|
|
mod config;
|
|
mod proc;
|
|
|
|
#[cfg(test)]
|
|
mod test {
|
|
use super::*;
|
|
use std::{
|
|
path::Path,
|
|
};
|
|
|
|
#[test]
|
|
pub fn test() -> Result<(), error::Error>
|
|
{
|
|
let mut cont = container::DupeMap::new();
|
|
let mode = config::Mode::default();
|
|
let path = Path::new("test-input");
|
|
|
|
assert_eq!(proc::DupeCount{total:4, dupes:2}, proc::do_dir(path, 0, &mut cont, &mode)?);
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[cfg(feature="threads")]
|
|
pub async fn _test_async() -> Result<(), error::Error>
|
|
{
|
|
use std::sync::Arc;
|
|
use tokio::{
|
|
sync::Mutex,
|
|
};
|
|
let cont = Arc::new(Mutex::new(container::DupeMap::new()));
|
|
let mode = config::Mode::default();
|
|
let path = Path::new("test-input");
|
|
|
|
assert_eq!(proc::DupeCount{total:4, dupes:2}, proc::do_dir_async(path, 0, cont, mode).await?);
|
|
|
|
Ok(())
|
|
}
|
|
#[cfg(feature="threads")]
|
|
#[test]
|
|
pub fn test_async() -> Result<(), error::Error>
|
|
{
|
|
tokio_test::block_on(_test_async())
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
|
|
}
|