Files
codeql/python/ql/test/query-tests/Expressions/strings/test.py
2018-11-19 15:15:54 +00:00

47 lines
880 B
Python

def test():
single_string = [
"foo"
"bar"
"/usr/local"
"/usr/bin"
]
explict_concat = [
"foo" +
"bar",
"/usr/local",
"/usr/bin"
]
error1 = [
"foo",
"/usr/local"
"/usr/bin"
]
error2 = [
"foo" +
"bar",
"/usr/local"
"/usr/bin"
]
#Examples from documentation
def unclear():
# Returns [ "first part of long string and the second part", "/usr/local/usr/bin" ]
return [
"first part of long string"
" and the second part",
"/usr/local"
"/usr/bin"
]
def clarified():
# Returns [ "first part of long string and the second part", "/usr/local", "/usr/bin" ]
return [
"first part of long string" +
" and the second part",
"/usr/local",
"/usr/bin"
]