Skip to content

Commit

Permalink
fix(psa): fix duplicate content root path.
Browse files Browse the repository at this point in the history
  • Loading branch information
ynfeng committed Feb 26, 2021
1 parent 969f461 commit 5bdc72c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion psa/src/jvm/maven_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ impl MavenModuleAnalyzer {
fn detect_sub_modules(&self, module_path: &str, module: &mut Option<Module>) {
let sub_modules = &mut self.analysis_sub_modules(module_path);
module.as_mut().unwrap().add_sub_modules(sub_modules);
self.detect_content_root(module_path, module);
}

fn analysis_sub_modules(&self, module_path: &str) -> Vec<Module> {
Expand Down
4 changes: 4 additions & 0 deletions psa/src/jvm/psa_jvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ mod tests {

let expect_source_path =
join_path(project_module.path.as_str(), vec!["src", "main", "java"]);
assert_eq!(project_content_root.source_root.len(), 1);
assert_eq!(
project_content_root.source_root.get(0).unwrap().as_str(),
expect_source_path.as_str()
Expand All @@ -147,13 +148,15 @@ mod tests {
project_module.path.as_str(),
vec!["src", "main", "resources"],
);
assert_eq!(project_content_root.resource_root.len(), 1);
assert_eq!(
project_content_root.resource_root.get(0).unwrap().as_str(),
expect_resource_path.as_str()
);

let expect_test_source_root =
join_path(project_module.path.as_str(), vec!["src", "test", "java"]);
assert_eq!(project_content_root.test_source_root.len(), 1);
assert_eq!(
project_content_root
.test_source_root
Expand All @@ -167,6 +170,7 @@ mod tests {
project_module.path.as_str(),
vec!["src", "test", "resources"],
);
assert_eq!(project_content_root.test_resource_root.len(), 1);
assert_eq!(
project_content_root.test_resource_root.get(0).unwrap(),
expect_test_resources_root.as_str()
Expand Down

0 comments on commit 5bdc72c

Please sign in to comment.