summaryrefslogtreecommitdiff
path: root/test_util
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-03-11 02:56:14 +0100
committerGitHub <noreply@github.com>2022-03-10 20:56:14 -0500
commit47f22777beb7eb98a07fa56fbbd40ab5c1fa231e (patch)
treeaa61065f07df3c1ad5a28326801720593a8cdd19 /test_util
parent808f797633ba82c0e9198481ddd742284a03cb9c (diff)
feat: "deno task" subcommand (#13725)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'test_util')
-rw-r--r--test_util/src/lib.rs13
1 files changed, 11 insertions, 2 deletions
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::<Vec<_>>())
+ } 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());