Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 42ecbdc

Browse files
committed
Add url unc-workaround unit test
Issue is a Windows one, but the test should pass on all platforms
1 parent ea18376 commit 42ecbdc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/cmd.rs

+16
Original file line numberDiff line numberDiff line change
@@ -532,3 +532,19 @@ Supported commands:
532532
resolve label detail
533533
completionItem/resolve");
534534
}
535+
536+
537+
// Reproducible on Windows where current dir can produce a url something like
538+
// `file:////?\C:\Users\alex\project\rls` which will later cause issues
539+
#[test]
540+
fn url_workaround_unc_canonicals() {
541+
let current_dir = ::std::env::current_dir().unwrap();
542+
let url = url(current_dir.to_str().unwrap());
543+
544+
let url_str = format!("{}", url);
545+
assert!(
546+
!url_str.starts_with(r"file:////?\"),
547+
"Unexpected UNC url {}",
548+
url
549+
);
550+
}

0 commit comments

Comments
 (0)