From ca1c9120b5b2ab0c0d168a8bb073fe15bd2aa06b Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 8 Oct 2024 14:37:23 +0100 Subject: [PATCH] PS: Add test with missing flow. --- .../test/library-tests/dataflow/fields/test.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/powershell/ql/test/library-tests/dataflow/fields/test.ps1 b/powershell/ql/test/library-tests/dataflow/fields/test.ps1 index f235c96e948..dc451cbbee8 100644 --- a/powershell/ql/test/library-tests/dataflow/fields/test.ps1 +++ b/powershell/ql/test/library-tests/dataflow/fields/test.ps1 @@ -44,4 +44,18 @@ $arr9 = @(0, 1, $y) Sink $arr9[0] # clean Sink $arr9[1] # clean Sink $arr9[2] # $ MISSING: hasValueFlow=11 -Sink $arr9[$unknown] # MISSING: hasValueFlow=11 \ No newline at end of file +Sink $arr9[$unknown] # MISSING: hasValueFlow=11 + +class MyClass { + [string] $field + + [void]callSink() { + Sink $this.field # $ MISSING: hasValueFlow=12 + } +} + +$myClass = [MyClass]::new() + +$myClass.field = Source "12" + +$myClass.callSink() \ No newline at end of file