use super::*;
#[test]
fn prompt_task_builder_parses_request() {
let cli = Cli::try_parse_from([
"cueloop",
"prompt",
"task-builder",
"--request",
"Add tests",
])
.expect("parse");
match cli.command {
Command::Prompt(args) => match args.command {
PromptCommand::TaskBuilder(t) => {
assert_eq!(t.request.as_deref(), Some("Add tests"));
}
_ => panic!("expected task-builder command"),
},
_ => panic!("expected prompt command"),
}
}
#[test]
fn prompt_task_builder_parses_tags() {
let cli = Cli::try_parse_from(["cueloop", "prompt", "task-builder", "--tags", "rust,tests"])
.expect("parse");
match cli.command {
Command::Prompt(args) => match args.command {
PromptCommand::TaskBuilder(t) => {
assert_eq!(t.tags, "rust,tests");
}
_ => panic!("expected task-builder command"),
},
_ => panic!("expected prompt command"),
}
}
#[test]
fn prompt_task_builder_parses_scope() {
let cli = Cli::try_parse_from([
"cueloop",
"prompt",
"task-builder",
"--scope",
"crates/cueloop",
])
.expect("parse");
match cli.command {
Command::Prompt(args) => match args.command {
PromptCommand::TaskBuilder(t) => {
assert_eq!(t.scope, "crates/cueloop");
}
_ => panic!("expected task-builder command"),
},
_ => panic!("expected prompt command"),
}
}
#[test]
fn prompt_task_builder_parses_repo_prompt_plan() {
let cli = Cli::try_parse_from(["cueloop", "prompt", "task-builder", "--repo-prompt", "plan"])
.expect("parse");
match cli.command {
Command::Prompt(args) => match args.command {
PromptCommand::TaskBuilder(t) => {
assert_eq!(t.repo_prompt, Some(RepoPromptMode::Plan));
}
_ => panic!("expected task-builder command"),
},
_ => panic!("expected prompt command"),
}
}
#[test]
fn prompt_task_builder_parses_explain() {
let cli =
Cli::try_parse_from(["cueloop", "prompt", "task-builder", "--explain"]).expect("parse");
match cli.command {
Command::Prompt(args) => match args.command {
PromptCommand::TaskBuilder(t) => {
assert!(t.explain);
}
_ => panic!("expected task-builder command"),
},
_ => panic!("expected prompt command"),
}
}