Skip to content

Commit b34e369

Browse files
committed
PS: Add failing tests.
1 parent 0814a90 commit b34e369

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
models
2+
edges
3+
nodes
4+
subpaths
5+
testFailures
6+
#select
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
function callSourceOnce {
2+
Source "1"
3+
}
4+
5+
$x = callSourceOnce
6+
Sink $x # $ MISSING: hasValueFlow=1
7+
8+
function callSourceTwice {
9+
Source "2"
10+
Source "3"
11+
}
12+
13+
$x = callSourceTwice
14+
Sink $x # $ MISSING: hasValueFlow=2 hasValueFlow=3
15+
16+
function returnSource1 {
17+
return Source "4"
18+
}
19+
20+
$x = returnSource1
21+
Sink $x # $ MISSING: hasValueFlow=4
22+
23+
function returnSource2 {
24+
$x = Source "5"
25+
$x
26+
$y = Source "6"
27+
return $y
28+
}
29+
30+
$x = returnSource2
31+
Sink $x # $ MISSING: hasValueFlow=5 hasValueFlow=6
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @kind path-problem
3+
*/
4+
5+
import powershell
6+
import semmle.code.powershell.dataflow.DataFlow
7+
private import TestUtilities.InlineFlowTest
8+
import DefaultFlowTest
9+
import ValueFlow::PathGraph
10+
11+
from ValueFlow::PathNode source, ValueFlow::PathNode sink
12+
where ValueFlow::flowPath(source, sink)
13+
select sink, source, sink, "$@", source, source.toString()

0 commit comments

Comments
 (0)