Skip to content

Commit

Permalink
add did_change_stress_test back
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Nov 9, 2023
1 parent 57994a9 commit e103a15
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions sway-lsp/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,26 @@ async fn did_cache_test() {
shutdown_and_exit(&mut service).await;
}

// #[tokio::test]
#[allow(dead_code)]
async fn did_change_stress_test() {
let (mut service, _) = LspService::build(ServerState::new)
.custom_method("sway/metrics", ServerState::metrics)
.finish();
let uri = init_and_open(&mut service, doc_comments_dir().join("src/main.sw")).await;
let times = 20;
for _ in 0..times {
let _ = lsp::did_change_request(&mut service, &uri).await;
let metrics = lsp::metrics_request(&mut service, &uri).await;
for (path, metrics) in metrics {
if path.contains("sway-lib-core") || path.contains("sway-lib-std") {
assert!(metrics.reused_modules >= 1);
}
}
}
shutdown_and_exit(&mut service).await;
}

#[tokio::test]
async fn lsp_syncs_with_workspace_edits() {
let (mut service, _) = LspService::new(ServerState::new);
Expand Down

0 comments on commit e103a15

Please sign in to comment.