Python: Rewrite inline expectation tests to use parameterized module

This commit is contained in:
Jeroen Ketema
2023-06-07 13:37:23 +02:00
parent 49993b023e
commit 8f599faf85
28 changed files with 105 additions and 84 deletions

View File

@@ -0,0 +1,2 @@
failures
testFailures

View File

@@ -3,12 +3,10 @@ import semmle.python.dataflow.new.DataFlow
import TestUtilities.InlineExpectationsTest
import experimental.dataflow.testConfig
class CaptureTest extends InlineExpectationsTest {
CaptureTest() { this = "CaptureTest" }
module CaptureTest implements TestSig {
string getARelevantTag() { result = "captured" }
override string getARelevantTag() { result = "captured" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node sink | exists(TestConfiguration cfg | cfg.hasFlowTo(sink)) |
location = sink.getLocation() and
tag = "captured" and
@@ -17,3 +15,5 @@ class CaptureTest extends InlineExpectationsTest {
)
}
}
import MakeTest<CaptureTest>