mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python tests: Move helper predicate into TestUtils.qll
This commit is contained in:
@@ -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