From 5e2051bdeac6153085ec09bb6eb53cd31cb6a86b Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 26 Sep 2024 18:44:40 +0100 Subject: [PATCH] PS: Add test. --- .../library-tests/dataflow/params/test.ps1 | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/powershell/ql/test/library-tests/dataflow/params/test.ps1 b/powershell/ql/test/library-tests/dataflow/params/test.ps1 index 0fe835d8bee..c217580d723 100644 --- a/powershell/ql/test/library-tests/dataflow/params/test.ps1 +++ b/powershell/ql/test/library-tests/dataflow/params/test.ps1 @@ -3,4 +3,37 @@ function Foo($a) { } $x = Source "1" -Foo $x \ No newline at end of file +Foo $x + +function ThreeArgs($x, $y, $z) { + Sink $x # $ MISSING: hasValueFlow=x + Sink $y # $ MISSING: hasValueFlow=y + Sink $z # $ MISSING: hasValueFlow=z +} + +$first = Source "x" +$second = Source "y" +$third = Source "z" + +ThreeArgs $first $second $third +ThreeArgs $second -x $first $third +ThreeArgs -x $first $second $third +ThreeArgs $first -y $second $third +ThreeArgs -y $second $first $third +ThreeArgs $second -x $first -z $third +ThreeArgs -x $first $second -z $third +ThreeArgs $first -y $second -z $third +ThreeArgs -y $second $first -z $third +ThreeArgs $second -x $first -z $third +ThreeArgs -x $first -z $third $second +ThreeArgs $first -y $second -z $third +ThreeArgs -y $second -z $third $first +ThreeArgs $second -z $third -x $first +ThreeArgs -x $first -z $third $second +ThreeArgs $first -z $third -y $second +ThreeArgs -y $second -z $third $first +ThreeArgs -z $third -y $second $first +ThreeArgs -z $third $second -x $first +ThreeArgs -z $third -x $first $second +ThreeArgs -z $third $first -y $second +ThreeArgs -z $third -y $second $first \ No newline at end of file