Java: Post-processing query for inline test expectations

This commit is contained in:
Tom Hvitved
2024-09-23 09:41:25 +02:00
parent 8ba80fd022
commit e2b614d18a
5 changed files with 358 additions and 72 deletions

View File

@@ -0,0 +1,21 @@
/**
* @kind test-postprocess
*/
private import java
private import codeql.util.test.InlineExpectationsTest as T
private import internal.InlineExpectationsTestImpl
import T::TestPostProcessing
import T::TestPostProcessing::Make<Impl, Input>
private module Input implements T::TestPostProcessing::InputSig<Impl> {
string getRelativeUrl(Location location) {
exists(File f, int startline, int startcolumn, int endline, int endcolumn |
location.hasLocationInfo(_, startline, startcolumn, endline, endcolumn) and
f = location.getFile()
|
result =
f.getRelativePath() + ":" + startline + ":" + startcolumn + ":" + endline + ":" + endcolumn
)
}
}