@@ -111,6 +111,7 @@ class CodeExecutionTest extends InlineExpectationsTest {
111
111
override string getARelevantTag ( ) { result = "getCode" }
112
112
113
113
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
114
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
114
115
exists ( CodeExecution ce , DataFlow:: Node code |
115
116
exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
116
117
code = ce .getCode ( ) and
@@ -128,6 +129,7 @@ class SqlExecutionTest extends InlineExpectationsTest {
128
129
override string getARelevantTag ( ) { result = "getSql" }
129
130
130
131
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
132
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
131
133
exists ( SqlExecution e , DataFlow:: Node sql |
132
134
exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
133
135
sql = e .getSql ( ) and
@@ -145,6 +147,7 @@ class HttpServerRouteSetupTest extends InlineExpectationsTest {
145
147
override string getARelevantTag ( ) { result in [ "routeSetup" ] }
146
148
147
149
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
150
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
148
151
exists ( HTTP:: Server:: RouteSetup setup |
149
152
___location = setup .getLocation ( ) and
150
153
element = setup .toString ( ) and
@@ -165,19 +168,22 @@ class HttpServerRequestHandlerTest extends InlineExpectationsTest {
165
168
override string getARelevantTag ( ) { result in [ "requestHandler" , "routedParameter" ] }
166
169
167
170
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
168
- exists ( HTTP:: Server:: RequestHandler handler |
169
- ___location = handler .getLocation ( ) and
170
- element = handler .toString ( ) and
171
- value = "" and
172
- tag = "requestHandler"
173
- )
174
- or
175
- exists ( HTTP:: Server:: RequestHandler handler , Parameter param |
176
- param = handler .getARoutedParameter ( ) and
177
- ___location = param .getLocation ( ) and
178
- element = param .toString ( ) and
179
- value = param .asName ( ) .getId ( ) and
180
- tag = "routedParameter"
171
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
172
+ (
173
+ exists ( HTTP:: Server:: RequestHandler handler |
174
+ ___location = handler .getLocation ( ) and
175
+ element = handler .toString ( ) and
176
+ value = "" and
177
+ tag = "requestHandler"
178
+ )
179
+ or
180
+ exists ( HTTP:: Server:: RequestHandler handler , Parameter param |
181
+ param = handler .getARoutedParameter ( ) and
182
+ ___location = param .getLocation ( ) and
183
+ element = param .toString ( ) and
184
+ value = param .asName ( ) .getId ( ) and
185
+ tag = "routedParameter"
186
+ )
181
187
)
182
188
}
183
189
}
@@ -198,7 +204,7 @@ class HttpServerHttpResponseTest extends InlineExpectationsTest {
198
204
// flask tests more readable since adding full annotations for HttpResponses in the
199
205
// the tests for routing setup is both annoying and not very useful.
200
206
___location .getFile ( ) = file and
201
- tag = getARelevantTag ( ) and
207
+ exists ( file . getRelativePath ( ) ) and
202
208
(
203
209
exists ( HTTP:: Server:: HttpResponse response |
204
210
___location = response .getLocation ( ) and
@@ -237,8 +243,8 @@ class FileSystemAccessTest extends InlineExpectationsTest {
237
243
override string getARelevantTag ( ) { result = "getAPathArgument" }
238
244
239
245
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
246
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
240
247
exists ( FileSystemAccess a , DataFlow:: Node path |
241
- exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
242
248
path = a .getAPathArgument ( ) and
243
249
___location = a .getLocation ( ) and
244
250
element = path .toString ( ) and
@@ -254,8 +260,8 @@ class PathNormalizationTest extends InlineExpectationsTest {
254
260
override string getARelevantTag ( ) { result = "pathNormalization" }
255
261
256
262
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
263
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
257
264
exists ( Path:: PathNormalization n |
258
- exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
259
265
___location = n .getLocation ( ) and
260
266
element = n .toString ( ) and
261
267
value = "" and
@@ -270,8 +276,8 @@ class SafeAccessCheckTest extends InlineExpectationsTest {
270
276
override string getARelevantTag ( ) { result in [ "checks" , "branch" ] }
271
277
272
278
override predicate hasActualResult ( Location ___location , string element , string tag , string value ) {
279
+ exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
273
280
exists ( Path:: SafeAccessCheck c , DataFlow:: Node checks , boolean branch |
274
- exists ( ___location .getFile ( ) .getRelativePath ( ) ) and
275
281
c .checks ( checks .asCfgNode ( ) , branch ) and
276
282
___location = c .getLocation ( ) and
277
283
(
0 commit comments