Files
codeql/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql
Joe Farebrother b5805503fe Cleanups
2025-04-04 11:56:07 +01:00

20 lines
593 B
Plaintext

import python
import Variables.LoopVariableCapture.LoopVariableCaptureQuery
import utils.test.InlineExpectationsTest
module MethodArgTest implements TestSig {
string getARelevantTag() { result = "capturedVar" }
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(CallableExpr capturing, Variable var |
escapingCapture(capturing, _, var, _, _) and
element = capturing.toString() and
location = capturing.getLocation() and
tag = "capturedVar" and
value = var.getId()
)
}
}
import MakeTest<MethodArgTest>