test(maven): compare JDTLS exclusions with forward-slash paths

Exclusions are written with forward slashes so they work as Java globs on Windows; the tests compared them with native paths and failed there.
Цей коміт міститься в:
l0ng-ai committed 2026-10-30 09:19:33 +08:00
1 джерело 6c1eba9d82
коміт 08956b615e
2 files changed
+6 -4

No files matched your search

+4 -2
Переглянути файл
@@ -993,8 +993,10 @@ mod maven_linkage_tests {
ide_sdk::apply::configure_maven_import(&mut server, tmp.path(), &excluded_poms);
let options = serde_json::to_value(server.initialization_options).unwrap();
let exclusions = options.pointer("/settings/java/import/exclusions").unwrap().as_array().unwrap();
assert!(exclusions.contains(&serde_json::json!(tmp.path().join("a").to_string_lossy())));
assert!(exclusions.contains(&serde_json::json!(tmp.path().join("a/child").to_string_lossy())));
assert!(exclusions.contains(&serde_json::json!(tmp.path().join("a").to_string_lossy().replace('\\', "/"))));
assert!(
exclusions.contains(&serde_json::json!(tmp.path().join("a/child").to_string_lossy().replace('\\', "/")))
);
let roots = super::linked_roots(tmp.path(), &settings, &detected);
assert!(roots.roots.iter().any(|r| r.path == "b/src/main/java"));
assert!(!roots.roots.iter().any(|r| r.path.starts_with("a/")));
+2 -2
Переглянути файл
@@ -735,8 +735,8 @@ mod maven_linkage_tests {
let options = serde_json::to_value(cfg.initialization_options).unwrap();
let exclusions = options.pointer("/settings/java/import/exclusions").unwrap().as_array().unwrap();
assert!(exclusions.contains(&json!("**/custom")));
assert!(exclusions.contains(&json!(tmp.path().join("a").to_string_lossy())));
assert!(exclusions.contains(&json!(tmp.path().join("a/child").to_string_lossy())));
assert!(exclusions.contains(&json!(tmp.path().join("a").to_string_lossy().replace('\\', "/"))));
assert!(exclusions.contains(&json!(tmp.path().join("a/child").to_string_lossy().replace('\\', "/"))));
assert!(cfg.args[1].starts_with("/cache/jdtls-maven-"));
}
}