mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
parent
24c7bded35
commit
4737a5c01e
3 changed files with 46 additions and 20 deletions
|
@ -13,10 +13,19 @@ mod editor_launch_test {
|
|||
use roc_utils::root_dir;
|
||||
use std::io::Read;
|
||||
|
||||
// ignored because we don't want to bring up the editor window during regular tests, only on specific CI machines
|
||||
#[ignore]
|
||||
#[ignore = "we don't want to bring up the editor window during regular tests, only on specific CI machines"]
|
||||
#[test]
|
||||
fn launch() {
|
||||
fn launch_test() {
|
||||
launch(None);
|
||||
|
||||
// with a file arg
|
||||
launch(Some("roc-projects/new-roc-project-1/main.roc"));
|
||||
|
||||
// with a folder arg
|
||||
launch(Some("roc-projects/new-roc-project-1"));
|
||||
}
|
||||
|
||||
fn launch(arg_path_str_opt: Option<&str>) {
|
||||
let root_dir = root_dir();
|
||||
|
||||
// The editor expects to be run from the root of the repo, so it can find the cli-platform to init a new project folder.
|
||||
|
@ -25,8 +34,14 @@ mod editor_launch_test {
|
|||
|
||||
let roc_binary_path = build_roc_bin_cached();
|
||||
|
||||
let mut cmd_args = vec![CMD_EDIT];
|
||||
|
||||
if let Some(arg_path_str) = arg_path_str_opt {
|
||||
cmd_args.push(arg_path_str)
|
||||
}
|
||||
|
||||
let mut roc_process = Command::new(roc_binary_path)
|
||||
.arg(CMD_EDIT)
|
||||
.args(cmd_args)
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
.expect("Failed to start editor from cli.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue