дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
test(jdtls): compare resolved source paths as paths, not strings (#665)
java_class_file joins the package path with std::path, so on Windows the result uses backslashes while the test's expectation kept the literal forward slash from "p/Outer.java". Compare as Path so separator style does not matter. Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
1 джерело
f19eacc336
коміт
683f8d8826
1 file changed
+4
-1
@@ -1659,7 +1659,10 @@ async fn class_file_opening_routes_sources_and_binary_documents() {
|
||||
s.respond("workspace/executeCommand", json!({"org.eclipse.jdt.ls.core.sourcePaths":[sources]}));
|
||||
for class in ["Outer", "Outer$Nested", "Outer$1"] {
|
||||
let path = h.root.join(format!("target/classes/p/{class}.class"));
|
||||
assert_eq!(h.mgr.java_class_file(&path, None).await.unwrap(), source.to_string_lossy());
|
||||
let resolved = h.mgr.java_class_file(&path, None).await.unwrap();
|
||||
// Compare as paths: the manager joins the relative source path with std::path, so
|
||||
// separators can differ from the literal "p/Outer.java" used to build `source` on Windows.
|
||||
assert_eq!(Path::new(&resolved), source.as_path());
|
||||
}
|
||||
let path = h.root.join("build/classes/java/main/p/Missing.class");
|
||||
let uri = uri_of(&path);
|
||||
|
||||
Reference in new issue
Заблокувати користувача