Skip to content

Commit

Permalink
add unit tests to deps/mod #700
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Aug 15, 2022
1 parent 89d194f commit e348771
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/info/deps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ impl DependencyDetector {
Ok(output)
}
}

#[cfg(test)]
mod test {
use super::*;
use regex::Regex;

#[test]
fn test_get_dependencies() -> Result<()> {
let dependency_detector = DependencyDetector::new();
let deps = dependency_detector.get_dependencies(Path::new("."))?;
let re = Regex::new(r"^\d+ \(cargo\)$")?;
assert!(re.is_match(&deps));

Ok(())
}
}

0 comments on commit e348771

Please sign in to comment.