deepwash 1.4.0

A Command Line Interface to clean your machine (docker...)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use deepwash::tasks::clean::is_refused_path;
use std::path::{Path, PathBuf};

#[test]
fn refuses_root_home_and_scan_root() {
    let home = PathBuf::from("/Users/someone");
    let scan_root = PathBuf::from("/Users/someone/projects");
    assert!(is_refused_path(Path::new("/"), &home, Some(&scan_root)));
    assert!(is_refused_path(&home, &home, Some(&scan_root)));
    assert!(is_refused_path(&scan_root, &home, Some(&scan_root)));
    // a normal match under the scan root is allowed
    assert!(!is_refused_path(
        Path::new("/Users/someone/projects/app/node_modules"),
        &home,
        Some(&scan_root)
    ));
}