Python: Add concept tests

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-10-27 08:26:00 +01:00
parent 8350d64763
commit b6313dddb9
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
open("filepath") # $getAPathArgument="filepath"
open(file="filepath") # $getAPathArgument="filepath"
o = open
o("filepath") # f-:$getAPathArgument="filepath"
o(file="filepath") # f-:$getAPathArgument="filepath"

View File

@@ -0,0 +1,19 @@
import os.path
path = "un\\normalized/path"
p1 = os.path.normpath(path) # $pathNormalization
p2 = os.path.normpath(path=path) # $pathNormalization
np = os.path.normpath
p3 = np(path) # $pathNormalization
p4 = np(path=path) # $pathNormalization
def normalize(path):
return os.path.normpath(path) # $pathNormalization
p5 = normalize(path)
p6 = normalize(path=path)

View File

@@ -0,0 +1,4 @@
s = "taintedString"
if s.startswith("tainted"): # $checks=s $branch=true
pass