forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: support running an individual subtest
Similar to 'Test function at cursor', this allows running a test by placing the cursor inside the test function or on the t.Run call. It will search back from the current cursor position within the current outer test function for a line that contains t.Run. If a subtest is found, an appropriate call to runTestAtCursor is constructed and the test is executed by existing go test functionality. This is a port of microsoft/vscode-go#3199 Change-Id: Ibb2d1267bd44aa370e2cf9ff6554c18f0d67815c GitHub-Last-Rev: b8e33c0 GitHub-Pull-Request: golang#87 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/235447 Reviewed-by: Rebecca Stambler <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
- Loading branch information
1 parent
3d575bd
commit 6a61856
Showing
7 changed files
with
178 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/microsoft/vscode-go/gofixtures/subtests | ||
|
||
go 1.14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestSample(t *testing.T) { | ||
t.Run("sample test passing", func(t *testing.T) { | ||
|
||
}) | ||
|
||
t.Run("sample test failing", func(t *testing.T) { | ||
t.FailNow() | ||
}) | ||
|
||
testName := "dynamic test name" | ||
t.Run(testName, func(t *testing.T) { | ||
t.FailNow() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters