diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-08-06 17:30:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 17:30:28 -0400 |
commit | 864ce6e83224fb9fedfc83d5647fb103c219c8af (patch) | |
tree | 1cd07ae4dd14cb292759921a03d75034a120db72 /test_util/src/lib.rs | |
parent | 33c8d790c3d358a475c9ba828043e2c19e8d4b37 (diff) |
feat(repl): add --eval flag for evaluating code when the repl starts (#11590)
Diffstat (limited to 'test_util/src/lib.rs')
-rw-r--r-- | test_util/src/lib.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index dce2dfc59..228e568f1 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -1143,9 +1143,25 @@ pub fn run_and_collect_output( envs: Option<Vec<(String, String)>>, need_http_server: bool, ) -> (String, String) { + run_and_collect_output_with_args( + expect_success, + args.split_whitespace().collect(), + input, + envs, + need_http_server, + ) +} + +pub fn run_and_collect_output_with_args( + expect_success: bool, + args: Vec<&str>, + input: Option<Vec<&str>>, + envs: Option<Vec<(String, String)>>, + need_http_server: bool, +) -> (String, String) { let mut deno_process_builder = deno_cmd(); deno_process_builder - .args(args.split_whitespace()) + .args(args) .current_dir(&tests_path()) .stdin(Stdio::piped()) .stdout(Stdio::piped()) |