Skip to content

Commit 2615758

Browse files
Sysixautofix-ci[bot]Boshen
authored
test(language_server): fix slow test (#10659)
closes #10657 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Boshen <[email protected]>
1 parent eac205f commit 2615758

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

crates/oxc_language_server/src/worker.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -461,32 +461,30 @@ fn range_overlaps(a: Range, b: Range) -> bool {
461461
mod tests {
462462
use super::*;
463463

464-
#[ignore]
465464
#[test]
466465
fn test_get_root_uri() {
467466
let worker =
468-
WorkspaceWorker::new(&Uri::from_str("file://root/").unwrap(), Options::default());
467+
WorkspaceWorker::new(&Uri::from_str("file:///root/").unwrap(), Options::default());
469468

470-
assert_eq!(worker.get_root_uri(), Some(Uri::from_str("file://root/").unwrap()));
469+
assert_eq!(worker.get_root_uri(), Some(Uri::from_str("file:///root/").unwrap()));
471470
}
472471

473472
#[test]
474473
fn test_is_responsible() {
475474
let worker = WorkspaceWorker::new(
476-
&Uri::from_str("file://path/to/root").unwrap(),
475+
&Uri::from_str("file:///path/to/root").unwrap(),
477476
Options::default(),
478477
);
479478

480479
assert!(
481-
worker.is_responsible_for_uri(&Uri::from_str("file://path/to/root/file.js").unwrap())
480+
worker.is_responsible_for_uri(&Uri::from_str("file:///path/to/root/file.js").unwrap())
482481
);
482+
assert!(worker.is_responsible_for_uri(
483+
&Uri::from_str("file:///path/to/root/folder/file.js").unwrap()
484+
));
483485
assert!(
484-
worker.is_responsible_for_uri(
485-
&Uri::from_str("file://path/to/root/folder/file.js").unwrap()
486-
)
487-
);
488-
assert!(
489-
!worker.is_responsible_for_uri(&Uri::from_str("file://path/to/other/file.js").unwrap())
486+
!worker
487+
.is_responsible_for_uri(&Uri::from_str("file:///path/to/other/file.js").unwrap())
490488
);
491489
}
492490
}

0 commit comments

Comments
 (0)