mirror of
https://github.com/github/codeql.git
synced 2026-01-29 06:12:58 +01:00
Add tests for callees through function variables
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
missingCallee
|
||||
| test.go:58:2:58:8 | call to f | test.go:41:1:53:1 | function declaration |
|
||||
spuriousCallee
|
||||
| main.go:44:3:44:7 | call to m | main.go:17:1:17:17 | function declaration |
|
||||
| main.go:44:3:44:7 | call to m | main.go:21:1:21:20 | function declaration |
|
||||
| main.go:56:2:56:6 | call to m | main.go:21:1:21:20 | function declaration |
|
||||
| test.go:42:2:42:13 | call to Write | test.go:36:1:39:1 | function declaration |
|
||||
| test.go:44:2:44:8 | call to f1 | test.go:36:1:39:1 | function declaration |
|
||||
|
||||
@@ -40,10 +40,20 @@ func (_ MockWriter) Write(p []byte) (n int, err error) { // name: MockWriter.Wri
|
||||
|
||||
func test5(h hash.Hash, w io.Writer) { // name: test5
|
||||
h.Write(nil) // callee: MockHash.Write
|
||||
f1 := h.Write
|
||||
f1(nil) // callee: MockHash.Write
|
||||
|
||||
w.Write(nil) // callee: MockWriter.Write callee: MockHash.Write
|
||||
h.Reset() // callee: Resetter.Reset
|
||||
f2 := w.Write
|
||||
f2(nil) // callee: MockWriter.Write callee: MockHash.Write
|
||||
|
||||
h.Reset() // callee: Resetter.Reset
|
||||
f3 := h.Reset
|
||||
f3() // callee: Resetter.Reset
|
||||
}
|
||||
|
||||
func test6(h MockHash, w MockWriter) {
|
||||
test5(h, w) // callee: test5
|
||||
f := test5
|
||||
f(h, w) // callee: test5
|
||||
}
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
missingCallee
|
||||
| test.go:44:2:44:8 | call to f1 | test.go:17:1:20:1 | function declaration |
|
||||
| test.go:48:2:48:8 | call to f2 | test.go:17:1:20:1 | function declaration |
|
||||
| test.go:48:2:48:8 | call to f2 | test.go:36:1:39:1 | function declaration |
|
||||
| test.go:52:2:52:5 | call to f3 | test.go:11:1:11:28 | function declaration |
|
||||
| test.go:58:2:58:8 | call to f | test.go:41:1:53:1 | function declaration |
|
||||
spuriousCallee
|
||||
|
||||
Reference in New Issue
Block a user