This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new test for
FunctionInputsAndOutputs
.
- Loading branch information
1 parent
c905149
commit 9c640ff
Showing
8 changed files
with
32 additions
and
0 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
1 change: 1 addition & 0 deletions
1
ql/test/library-tests/semmle/go/dataflow/FunctionInputsAndOutputs/FunctionModelStep.expected
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
| file://:0:0:0:0 | Encode | tst2.go:10:35:10:38 | data | tst2.go:10:9:10:26 | call to NewEncoder | | ||
| file://:0:0:0:0 | ReadFrom | tst.go:10:23:10:28 | reader | tst.go:9:2:9:12 | definition of bytesBuffer | | ||
| file://:0:0:0:0 | Reset | reset.go:12:15:12:20 | source | reset.go:11:6:11:11 | definition of reader | |
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
7 changes: 7 additions & 0 deletions
7
...ary-tests/semmle/go/dataflow/FunctionInputsAndOutputs/FunctionOutput_getExitNode.expected
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 |
---|---|---|
@@ -1,19 +1,26 @@ | ||
| parameter 0 | reset.go:12:2:12:21 | call to Reset | reset.go:9:2:9:7 | definition of source | | ||
| parameter 0 | tst2.go:10:9:10:26 | call to NewEncoder | tst2.go:9:6:9:6 | definition of w | | ||
| parameter 0 | tst2.go:10:9:10:39 | call to Encode | tst2.go:8:12:8:15 | definition of data | | ||
| parameter 0 | tst.go:10:2:10:29 | call to ReadFrom | tst.go:8:12:8:17 | definition of reader | | ||
| parameter 0 | tst.go:16:2:16:12 | call to test5 | tst.go:15:12:15:12 | definition of x | | ||
| parameter 1 | tst.go:16:2:16:12 | call to test5 | tst.go:15:15:15:15 | definition of y | | ||
| receiver | main.go:53:14:53:21 | call to bump | main.go:52:2:52:2 | definition of c | | ||
| receiver | reset.go:12:2:12:21 | call to Reset | reset.go:11:6:11:11 | definition of reader | | ||
| receiver | tst2.go:10:9:10:39 | call to Encode | tst2.go:10:9:10:26 | call to NewEncoder | | ||
| receiver | tst.go:10:2:10:29 | call to ReadFrom | tst.go:9:2:9:12 | definition of bytesBuffer | | ||
| result | main.go:51:2:51:14 | call to op | main.go:51:2:51:14 | call to op | | ||
| result | main.go:53:2:53:22 | call to op2 | main.go:53:2:53:22 | call to op2 | | ||
| result | main.go:53:14:53:21 | call to bump | main.go:53:14:53:21 | call to bump | | ||
| result | tst2.go:10:9:10:26 | call to NewEncoder | tst2.go:10:9:10:26 | call to NewEncoder | | ||
| result | tst2.go:10:9:10:39 | call to Encode | tst2.go:10:9:10:39 | call to Encode | | ||
| result | tst.go:9:17:9:33 | call to new | tst.go:9:17:9:33 | call to new | | ||
| result 0 | main.go:51:2:51:14 | call to op | main.go:51:2:51:14 | call to op | | ||
| result 0 | main.go:53:2:53:22 | call to op2 | main.go:53:2:53:22 | call to op2 | | ||
| result 0 | main.go:53:14:53:21 | call to bump | main.go:53:14:53:21 | call to bump | | ||
| result 0 | main.go:54:10:54:15 | call to test | main.go:54:2:54:15 | ... := ...[0] | | ||
| result 0 | main.go:56:9:56:15 | call to test2 | main.go:56:2:56:15 | ... = ...[0] | | ||
| result 0 | tst2.go:10:9:10:26 | call to NewEncoder | tst2.go:10:9:10:26 | call to NewEncoder | | ||
| result 0 | tst2.go:10:9:10:39 | call to Encode | tst2.go:10:9:10:39 | call to Encode | | ||
| result 0 | tst.go:9:17:9:33 | call to new | tst.go:9:17:9:33 | call to new | | ||
| result 1 | main.go:54:10:54:15 | call to test | main.go:54:2:54:15 | ... := ...[1] | | ||
| result 1 | main.go:56:9:56:15 | call to test2 | main.go:56:2:56:15 | ... = ...[1] | |
2 changes: 2 additions & 0 deletions
2
...ibrary-tests/semmle/go/dataflow/FunctionInputsAndOutputs/FunctionOutput_isResult.expected
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
| main.go:51:2:51:14 | call to op | main.go:51:2:51:14 | call to op | result | | ||
| main.go:53:2:53:22 | call to op2 | main.go:53:2:53:22 | call to op2 | result | | ||
| main.go:53:14:53:21 | call to bump | main.go:53:14:53:21 | call to bump | result | | ||
| tst2.go:10:9:10:26 | call to NewEncoder | tst2.go:10:9:10:26 | call to NewEncoder | result | | ||
| tst2.go:10:9:10:39 | call to Encode | tst2.go:10:9:10:39 | call to Encode | result | | ||
| tst.go:9:17:9:33 | call to new | tst.go:9:17:9:33 | call to new | result | |
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
12 changes: 12 additions & 0 deletions
12
ql/test/library-tests/semmle/go/dataflow/FunctionInputsAndOutputs/tst2.go
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,12 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"io" | ||
) | ||
|
||
func test7(data interface{}) (io.Writer, error) { | ||
var w io.Writer | ||
err := json.NewEncoder(w).Encode(data) | ||
return w, err | ||
} |