From 38fb841d1f4f8d18bdb097a4805398c59759b38a Mon Sep 17 00:00:00 2001 From: Connor Finnell Date: Wed, 3 Jul 2024 09:53:19 -0600 Subject: [PATCH] Use regex to properly select Go test runnable (#13750) This is already done when selecting a subtest; by wrapping the test name with `^{}$` the runnable will avoid selecting additional tests with the same prefix. Without this fix, selecting the runnable for `TestExample` will also run `TestExample2`. Release Notes: - Fixed Golang tasks spawning tests starting with the current function name and not using the exact match. --- crates/languages/src/go.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/go.rs b/crates/languages/src/go.rs index 48641c5729e1c3cfefb9fad755c33608bebf23b5..47226efefa606f30c40dc9ca54d7efac3fbfd5e4 100644 --- a/crates/languages/src/go.rs +++ b/crates/languages/src/go.rs @@ -518,7 +518,7 @@ impl ContextProvider for GoContextProvider { "test".into(), GO_PACKAGE_TASK_VARIABLE.template_value(), "-run".into(), - VariableName::Symbol.template_value(), + format!("^{}$", VariableName::Symbol.template_value(),), ], tags: vec!["go-test".to_owned()], ..TaskTemplate::default()