Skip to content

Commit a7c268f

Browse files
committed
Python: adjust test.
1 parent 1b13790 commit a7c268f

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

python/ql/test/experimental/meta/ConceptsTest.qll

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -440,22 +440,15 @@ class PathNormalizationTest extends InlineExpectationsTest {
440440
class SafeAccessCheckTest extends InlineExpectationsTest {
441441
SafeAccessCheckTest() { this = "SafeAccessCheckTest" }
442442

443-
override string getARelevantTag() { result in ["checks", "branch"] }
443+
override string getARelevantTag() { result = "SafeAccessCheck" }
444444

445445
override predicate hasActualResult(Location location, string element, string tag, string value) {
446446
exists(location.getFile().getRelativePath()) and
447-
exists(Path::SafeAccessCheck c, DataFlow::Node checks, boolean branch |
448-
c.checks(checks.asCfgNode(), branch) and
447+
exists(Path::SafeAccessCheck c |
449448
location = c.getLocation() and
450-
(
451-
element = checks.toString() and
452-
value = prettyNodeForInlineTest(checks) and
453-
tag = "checks"
454-
or
455-
element = branch.toString() and
456-
value = branch.toString() and
457-
tag = "branch"
458-
)
449+
element = c.toString() and
450+
value = prettyNodeForInlineTest(c) and
451+
tag = "SafeAccessCheck"
459452
)
460453
}
461454
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
s = "taintedString"
22

3-
if s.startswith("tainted"): # $checks=s branch=true
3+
if s.startswith("tainted"):
4+
s2 = s # $SafeAccessCheck=s
45
pass
56

67
sw = s.startswith
7-
if sw("safe"): # $ MISSING: checks=s branch=true
8+
if sw("safe"):
9+
s2 = s # $ MISSING: SafeAccessCheck=s
810
pass

0 commit comments

Comments
 (0)