mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Merge pull request #782 from markshannon/python-add-more-tests
Python: Add more tests
This commit is contained in:
@@ -19,7 +19,7 @@ string message() {
|
||||
}
|
||||
|
||||
predicate exec_function_call(Call c) {
|
||||
major_version() = 3 and exists(GlobalVariable exec | exec = ((Name)c.getFunc()).getVariable() and exec.getId() = "exec")
|
||||
exists(GlobalVariable exec | exec = ((Name)c.getFunc()).getVariable() and exec.getId() = "exec")
|
||||
}
|
||||
|
||||
from AstNode exec
|
||||
|
||||
@@ -22,3 +22,11 @@ string remove_prefix_before_substring(string str, string sub) {
|
||||
string remove_library_prefix(Location loc) {
|
||||
result = remove_prefix_before_substring(loc.toString(), "resources/lib")
|
||||
}
|
||||
|
||||
/** Returns the location of an AST node in compact form: `basename:line:column` */
|
||||
string compact_location(AstNode a) {
|
||||
exists(Location l |
|
||||
l = a.getLocation() |
|
||||
result = l.getFile().getBaseName() + ":" + l.getStartLine() + ":" + l.getStartColumn()
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user