Skip to content

Commit 63263d5

Browse files
committed
Add failing tests for newly added functions
1 parent ecd5c8c commit 63263d5

File tree

15 files changed

+58
-7
lines changed

15 files changed

+58
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
invalidModelRow
22
testFailures
3+
| test.go:204:21:204:51 | comment | Missing result: hasTaintFlow="call to new" |
4+
| test.go:205:21:205:55 | comment | Missing result: hasTaintFlow="star expression" |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module semmle.go.Packages
22

3-
go 1.13
3+
go 1.26
44

55
require github.com/nonexistent/test v0.0.0-20200203000000-0000000000000

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/sinks.expected

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ invalidModelRow
4444
| test.go:199:23:199:26 | arg2 | qltest |
4545
| test.go:199:29:199:32 | arg3 | qltest |
4646
| test.go:202:22:202:25 | temp | qltest |
47-
| test.go:206:10:206:12 | src | qltest |
47+
| test.go:204:10:204:17 | call to new | qltest |
48+
| test.go:205:10:205:18 | star expression | qltest |
49+
| test.go:209:10:209:12 | src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/srcs.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ invalidModelRow
2222
| test.go:187:24:187:31 | call to Src1 | qltest |
2323
| test.go:191:24:191:31 | call to Src1 | qltest |
2424
| test.go:201:10:201:28 | selection of SourceVariable | qltest |
25-
| test.go:205:15:205:17 | definition of src | qltest |
25+
| test.go:208:15:208:17 | definition of src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ func simpleflow() {
200200

201201
temp := test.SourceVariable
202202
test.SinkVariable = temp // $ hasTaintFlow="temp"
203+
204+
b.Sink1(new(src)) // $ hasTaintFlow="call to new"
205+
b.Sink1(*new(src)) // $ hasTaintFlow="star expression"
203206
}
204207

205208
func srcParam(src string, b test.B) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
invalidModelRow
22
testFailures
3+
| test.go:213:21:213:55 | comment | Missing result: hasValueFlow="star expression" |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module semmle.go.Packages
22

3-
go 1.21
3+
go 1.26
44

55
require github.com/nonexistent/test v0.0.0-20200203000000-0000000000000

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/sinks.expected

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ invalidModelRow
5050
| test.go:206:10:206:26 | call to min | qltest |
5151
| test.go:207:10:207:26 | call to min | qltest |
5252
| test.go:210:22:210:25 | temp | qltest |
53-
| test.go:214:10:214:12 | src | qltest |
53+
| test.go:212:10:212:17 | call to new | qltest |
54+
| test.go:213:10:213:18 | star expression | qltest |
55+
| test.go:217:10:217:12 | src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/srcs.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ invalidModelRow
2222
| test.go:187:24:187:31 | call to Src1 | qltest |
2323
| test.go:191:24:191:31 | call to Src1 | qltest |
2424
| test.go:209:10:209:28 | selection of SourceVariable | qltest |
25-
| test.go:213:15:213:17 | definition of src | qltest |
25+
| test.go:216:15:216:17 | definition of src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ func simpleflow() {
208208

209209
temp := test.SourceVariable
210210
test.SinkVariable = temp // $ hasValueFlow="temp"
211+
212+
b.Sink1(new(src))
213+
b.Sink1(*new(src)) // $ hasValueFlow="star expression"
211214
}
212215

213216
func srcParam(src string, b test.B) {

0 commit comments

Comments
 (0)