Skip to content

Commit c8d7047

Browse files
committed
PS: Add tests with missing flow.
1 parent 8aa119b commit c8d7047

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

powershell/ql/test/library-tests/dataflow/fields/test.expected

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ edges
6464
| test.ps1:72:6:72:8 | x [element] | test.ps1:72:6:72:11 | ...[...] | provenance | |
6565
| test.ps1:73:6:73:8 | x [element] | test.ps1:73:6:73:11 | ...[...] | provenance | |
6666
| test.ps1:74:6:74:8 | x [element] | test.ps1:74:6:74:11 | ...[...] | provenance | |
67+
| test.ps1:86:1:86:6 | [post] hash [b] | test.ps1:87:6:87:11 | hash [b] | provenance | |
68+
| test.ps1:86:11:86:22 | Source | test.ps1:86:1:86:6 | [post] hash [b] | provenance | |
69+
| test.ps1:87:6:87:11 | hash [b] | test.ps1:87:6:87:13 | b | provenance | |
6770
nodes
6871
| test.ps1:1:1:1:3 | [post] a [f] | semmle.label | [post] a [f] |
6972
| test.ps1:1:8:1:18 | Source | semmle.label | Source |
@@ -141,6 +144,10 @@ nodes
141144
| test.ps1:73:6:73:11 | ...[...] | semmle.label | ...[...] |
142145
| test.ps1:74:6:74:8 | x [element] | semmle.label | x [element] |
143146
| test.ps1:74:6:74:11 | ...[...] | semmle.label | ...[...] |
147+
| test.ps1:86:1:86:6 | [post] hash [b] | semmle.label | [post] hash [b] |
148+
| test.ps1:86:11:86:22 | Source | semmle.label | Source |
149+
| test.ps1:87:6:87:11 | hash [b] | semmle.label | hash [b] |
150+
| test.ps1:87:6:87:13 | b | semmle.label | b |
144151
subpaths
145152
testFailures
146153
#select
@@ -167,3 +174,4 @@ testFailures
167174
| test.ps1:74:6:74:11 | ...[...] | test.ps1:64:10:64:21 | Source | test.ps1:74:6:74:11 | ...[...] | $@ | test.ps1:64:10:64:21 | Source | Source |
168175
| test.ps1:74:6:74:11 | ...[...] | test.ps1:65:10:65:21 | Source | test.ps1:74:6:74:11 | ...[...] | $@ | test.ps1:65:10:65:21 | Source | Source |
169176
| test.ps1:74:6:74:11 | ...[...] | test.ps1:66:10:66:21 | Source | test.ps1:74:6:74:11 | ...[...] | $@ | test.ps1:66:10:66:21 | Source | Source |
177+
| test.ps1:87:6:87:13 | b | test.ps1:86:11:86:22 | Source | test.ps1:87:6:87:13 | b | $@ | test.ps1:86:11:86:22 | Source | Source |

powershell/ql/test/library-tests/dataflow/fields/test.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,17 @@ function produce {
7171
$x = produce
7272
Sink $x[0] # $ hasValueFlow=13 hasValueFlow=14 hasValueFlow=15
7373
Sink $x[1] # $ hasValueFlow=13 hasValueFlow=14 hasValueFlow=15
74-
Sink $x[2] # $ hasValueFlow=13 hasValueFlow=14 hasValueFlow=15
74+
Sink $x[2] # $ hasValueFlow=13 hasValueFlow=14 hasValueFlow=15
75+
76+
$hash = @{
77+
a = Source "16"
78+
b = 2
79+
}
80+
81+
Sink $hash["a"] # $ MISSING: hasValueFlow=16
82+
Sink $hash["b"] # clean
83+
84+
$hash["a"] = 0
85+
Sink $hash["a"] # clean
86+
$hash.b = Source "17"
87+
Sink $hash.b # $ hasValueFlow=17

0 commit comments

Comments
 (0)