go: Add runnables for Go (#12003)
Implemented runnables for specially for running tests for Go. I'm grateful for your feedback because this is my first experience with Rust and Zed codebase.  https://github.com/zed-industries/zed/assets/1047345/ae1abd9e-3657-4322-9c28-02d0752b5ccd Release Notes: - Added Runnables/Tasks for: - Run test functions which start with "Test" - Run subtests - Run benchmark tests - Run main function --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
5665cad250
commit
ddb551c794
4 changed files with 155 additions and 23 deletions
|
@ -679,4 +679,27 @@ mod tests {
|
|||
expected.sort_by_key(|var| var.to_string());
|
||||
assert_eq!(resolved_variables, expected)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn substitute_funky_labels() {
|
||||
let faulty_go_test = TaskTemplate {
|
||||
label: format!(
|
||||
"go test {}/{}",
|
||||
VariableName::Symbol.template_value(),
|
||||
VariableName::Symbol.template_value(),
|
||||
),
|
||||
command: "go".into(),
|
||||
args: vec![format!(
|
||||
"^{}$/^{}$",
|
||||
VariableName::Symbol.template_value(),
|
||||
VariableName::Symbol.template_value()
|
||||
)],
|
||||
..TaskTemplate::default()
|
||||
};
|
||||
let mut context = TaskContext::default();
|
||||
context
|
||||
.task_variables
|
||||
.insert(VariableName::Symbol, "my-symbol".to_string());
|
||||
assert!(faulty_go_test.resolve_task("base", &context).is_some());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue