Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

test(jdtls): compare resolved source paths as paths, not strings (#665)

arookieofc683f8d8826af
diff --git a/crates/ide-lsp/tests/mock_server.rs b/crates/ide-lsp/tests/mock_server.rs
index 2cd2b4f9a..aa15d3ede 100644
--- a/crates/ide-lsp/tests/mock_server.rs
+++ b/crates/ide-lsp/tests/mock_server.rs
@@ -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);