@@ -13,14 +13,15 @@ import { GoTestResolver } from './resolve';
13
13
// - A 'package' is a folder that contains .go files (and is not a module)
14
14
// - A 'file' is a file ending with _test.go
15
15
// - A 'test' is a Go test, e.g. func TestXxx(t *testing.T)
16
- // - A 'benchmark' is a Go benchmark, e.g. func BenchmarkXxx(t *testing.T)
16
+ // - A 'benchmark' is a Go benchmark, e.g. func BenchmarkXxx(t *testing.B)
17
+ // - A 'fuzz' is a Fuzz test, e.g., func TestFuzz(f *testing.F)
17
18
// - An 'example' is a Go example, e.g. func ExampleXxx()
18
19
//
19
20
// The top-level test item for a workspace folder is always either a module or a
20
21
// workspace. If the user opens a file (containing tests) that is not contained
21
22
// within any workspace folder, a top-level package will be created as a parent
22
23
// of that file.
23
- export type GoTestKind = 'module' | 'workspace' | 'package' | 'file' | 'test' | 'benchmark' | 'example' ;
24
+ export type GoTestKind = 'module' | 'workspace' | 'package' | 'file' | 'test' | 'benchmark' | 'fuzz' | ' example';
24
25
25
26
export class GoTest {
26
27
// Constructs an ID for an item. The ID of a test item consists of the URI
@@ -34,6 +35,7 @@ export class GoTest {
34
35
// - File: file:///path/to/mod/file.go?file
35
36
// - Test: file:///path/to/mod/file.go?test#TestXxx
36
37
// - Benchmark: file:///path/to/mod/file.go?benchmark#BenchmarkXxx
38
+ // - Fuzz: file:///path/to/mod/file.go?test#FuzzXxx
37
39
// - Example: file:///path/to/mod/file.go?example#ExampleXxx
38
40
static id ( uri : vscode . Uri , kind : GoTestKind , name ?: string ) : string {
39
41
uri = uri . with ( { query : kind } ) ;
@@ -49,7 +51,7 @@ export class GoTest {
49
51
const u = vscode . Uri . parse ( id ) ;
50
52
const kind = u . query as GoTestKind ;
51
53
const name = u . fragment ;
52
- return { name , kind } ;
54
+ return { kind , name } ;
53
55
}
54
56
}
55
57
0 commit comments