File tree Expand file tree Collapse file tree 7 files changed +41
-2
lines changed Expand file tree Collapse file tree 7 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1
- go 1.14
1
+ go 1.18
2
2
3
3
module testsample
Original file line number Diff line number Diff line change
1
+ package pkg1
2
+
3
+ type Generic [T any ] struct {
4
+ element T
5
+ }
6
+
7
+ func TestMe () {}
Original file line number Diff line number Diff line change
1
+ package pkg1_test
2
+
3
+ import (
4
+ "testsample/pkg1"
5
+ )
6
+
7
+ func UsePkg1 () {
8
+ pkg1 .TestMe ()
9
+ }
Original file line number Diff line number Diff line change
1
+ package pkg1
2
+
3
+ func UsePkg1 () {
4
+ TestMe ()
5
+ }
Original file line number Diff line number Diff line change
1
+ package pkg2
2
+
3
+ import (
4
+ "testsample/pkg1"
5
+ )
6
+
7
+ // This tests the case of cross-package generic type references
8
+ // in the presence of test extraction. We need to make sure we
9
+ // extract packages, including test variants, in the right order
10
+ // such that we've seen pkg1.Generic before we try to use it here.
11
+
12
+ type Specialised = pkg1.Generic [string ]
Original file line number Diff line number Diff line change 1
1
#select
2
+ | src/pkg1/def.go:0:0:0:0 | src/pkg1/def.go |
3
+ | src/pkg1/def_blackbox_test.go:0:0:0:0 | src/pkg1/def_blackbox_test.go |
4
+ | src/pkg1/def_test.go:0:0:0:0 | src/pkg1/def_test.go |
5
+ | src/pkg2/use.go:0:0:0:0 | src/pkg2/use.go |
2
6
| src/testme.go:0:0:0:0 | src/testme.go |
3
7
| src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go |
4
8
| src/testme_test.go:0:0:0:0 | src/testme_test.go |
5
9
calls
10
+ | src/pkg1/def_blackbox_test.go:8:2:8:14 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration |
11
+ | src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration |
6
12
| src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration |
7
13
| src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration |
8
14
| src/testme_test.go:14:19:14:35 | call to privateFunction | src/testme.go:5:1:5:39 | function declaration |
Original file line number Diff line number Diff line change 1
1
import os
2
2
3
3
def test_traced (codeql , go ):
4
- codeql .database .create (source_root = "src" , command = "go test -c" )
4
+ codeql .database .create (source_root = "src" , command = "go test -c ./... " )
5
5
6
6
def test_autobuild (codeql , go ):
7
7
codeql .database .create (source_root = "src" , extractor_option = ["extract_tests=true" ])
You can’t perform that action at this time.
0 commit comments