From 0717c807c3a8217289b8f593847ba7d608f71994 Mon Sep 17 00:00:00 2001 From: Sam Rijs Date: Sun, 11 Feb 2018 21:25:25 +1100 Subject: [PATCH] add test for crawling internal dependencies --- src/engine/machines/crawler.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/engine/machines/crawler.rs b/src/engine/machines/crawler.rs index 72119cb..f6e08bf 100644 --- a/src/engine/machines/crawler.rs +++ b/src/engine/machines/crawler.rs @@ -139,6 +139,33 @@ codegen = "0.0.1" &CrateDep::External(VersionReq::parse("0.0.1").unwrap())); } + #[test] + fn package_manifest_with_internal_dependencies() { + let manifest = r#" +[package] +name = "piston" + +[dependencies.pistoncore-input] +path = "src/input" +version = "0.20.0" + +[dependencies.pistoncore-window] +path = "src/window" +version = "0.30.0" + +[dependencies.pistoncore-event_loop] +path = "src/event_loop" +version = "0.35.0" +"#; + + let mut crawler = ManifestCrawler::new(); + let step_output = crawler.step("".into(), manifest.to_string()).unwrap(); + assert_eq!(step_output.paths_of_interest.len(), 3); + assert_eq!(step_output.paths_of_interest[0].as_str(), "src/input"); + assert_eq!(step_output.paths_of_interest[1].as_str(), "src/window"); + assert_eq!(step_output.paths_of_interest[2].as_str(), "src/event_loop"); + } + #[test] fn simple_workspace_manifest() { let manifest = r#"