From 47f22777beb7eb98a07fa56fbbd40ab5c1fa231e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 11 Mar 2022 02:56:14 +0100 Subject: feat: "deno task" subcommand (#13725) Co-authored-by: David Sherret --- test_util/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test_util/src') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index f8872615c..664469cf8 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -1705,6 +1705,7 @@ pub fn run_powershell_script_file( #[derive(Debug, Default)] pub struct CheckOutputIntegrationTest { pub args: &'static str, + pub args_vec: Vec<&'static str>, pub output: &'static str, pub input: Option<&'static str>, pub output_str: Option<&'static str>, @@ -1715,7 +1716,15 @@ pub struct CheckOutputIntegrationTest { impl CheckOutputIntegrationTest { pub fn run(&self) { - let args = self.args.split_whitespace(); + let args = if self.args_vec.is_empty() { + std::borrow::Cow::Owned(self.args.split_whitespace().collect::>()) + } else { + assert!( + self.args.is_empty(), + "Do not provide args when providing args_vec." + ); + std::borrow::Cow::Borrowed(&self.args_vec) + }; let deno_exe = deno_exe_path(); println!("deno_exe path {}", deno_exe.display()); @@ -1730,7 +1739,7 @@ impl CheckOutputIntegrationTest { let mut command = deno_cmd(); println!("deno_exe args {}", self.args); println!("deno_exe testdata path {:?}", &testdata_dir); - command.args(args); + command.args(args.iter()); command.envs(self.envs.clone()); command.current_dir(&testdata_dir); command.stdin(Stdio::piped()); -- cgit v1.2.3