summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-03-30 17:47:53 -0400
committerGitHub <noreply@github.com>2023-03-30 17:47:53 -0400
commit772201449713fbefad6c42b9ce545a5bb2d7499b (patch)
tree3a0e0448ca4116cd5ed4c1ba7dafb331ad6215e3 /test_util/src
parent02e01b171f29f4f6c23d738b0756b7d9b7eaa020 (diff)
fix(lsp): include all diagnosable documents on initialize (#17979)
Closes https://github.com/denoland/vscode_deno/issues/797 Closes https://github.com/denoland/deno/issues/11190 Closes https://github.com/denoland/vscode_deno/issues/811 Closes https://github.com/denoland/vscode_deno/issues/761 Closes https://github.com/denoland/vscode_deno/issues/585 Closes https://github.com/denoland/vscode_deno/issues/561 Closes https://github.com/denoland/vscode_deno/issues/410
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/builders.rs7
-rw-r--r--test_util/src/lib.rs10
2 files changed, 8 insertions, 9 deletions
diff --git a/test_util/src/builders.rs b/test_util/src/builders.rs
index 4997dac2c..0a0f2244f 100644
--- a/test_util/src/builders.rs
+++ b/test_util/src/builders.rs
@@ -228,8 +228,11 @@ impl TestCommandBuilder {
self
}
- pub fn args_vec(&mut self, args: Vec<String>) -> &mut Self {
- self.args_vec = args;
+ pub fn args_vec<T: AsRef<str>, I: IntoIterator<Item = T>>(
+ &mut self,
+ args: I,
+ ) -> &mut Self {
+ self.args_vec = args.into_iter().map(|a| a.as_ref().to_string()).collect();
self
}
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index c844e594f..5c6bc97f7 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -2093,8 +2093,7 @@ impl<'a> CheckOutputIntegrationTest<'a> {
command_builder.args(self.args);
}
if !self.args_vec.is_empty() {
- command_builder
- .args_vec(self.args_vec.iter().map(|a| a.to_string()).collect());
+ command_builder.args_vec(self.args_vec.clone());
}
if let Some(input) = &self.input {
command_builder.stdin(input);
@@ -2167,11 +2166,8 @@ pub fn pattern_match(pattern: &str, s: &str, wildcard: &str) -> bool {
}
pub fn with_pty(deno_args: &[&str], action: impl FnMut(Pty)) {
- let context = TestContextBuilder::default().build();
- context
- .new_command()
- .args_vec(deno_args.iter().map(ToString::to_string).collect())
- .with_pty(action);
+ let context = TestContextBuilder::default().use_temp_cwd().build();
+ context.new_command().args_vec(deno_args).with_pty(action);
}
pub struct WrkOutput {