@@ -204,102 +204,142 @@ describe("pathsEqual", () => {
204204 return ;
205205 }
206206
207- expect ( pathsEqual ( path1 , path2 , platform ) ) . toEqual ( expected ) ;
207+ expect ( pathsEqual ( path1 , path2 ) ) . toEqual ( expected ) ;
208208 } ,
209209 ) ;
210210} ) ;
211211
212212describe ( "containsPath" , ( ) => {
213213 const testCases : Array < {
214- path1 : string ;
215- path2 : string ;
214+ parent : string ;
215+ child : string ;
216216 platform : NodeJS . Platform ;
217217 expected : boolean ;
218218 } > = [
219219 {
220- path1 :
220+ parent :
221221 "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
222- path2 :
222+ child :
223223 "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
224224 platform : "linux" ,
225225 expected : true ,
226226 } ,
227227 {
228- path1 :
228+ parent :
229229 "/HOME/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
230- path2 :
230+ child :
231231 "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
232232 platform : "linux" ,
233233 expected : false ,
234234 } ,
235235 {
236- path1 :
236+ parent :
237237 "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
238- path2 :
238+ child :
239239 "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
240240 platform : "linux" ,
241241 expected : false ,
242242 } ,
243243 {
244- path1 :
244+ parent :
245+ "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-java" ,
246+ child :
247+ "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
248+ platform : "linux" ,
249+ expected : false ,
250+ } ,
251+ {
252+ parent :
253+ "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-java" ,
254+ child :
255+ "/home/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
256+ platform : "linux" ,
257+ expected : false ,
258+ } ,
259+ {
260+ parent :
245261 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
246- path2 :
262+ child :
247263 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
248264 platform : "win32" ,
249265 expected : true ,
250266 } ,
251267 {
252- path1 :
268+ parent :
253269 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
254- path2 :
270+ child :
255271 "c:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
256272 platform : "win32" ,
257273 expected : true ,
258274 } ,
259275 {
260- path1 :
276+ parent :
261277 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
262- path2 :
278+ child :
279+ "C:/USERS/GITHUB/PROJECTS/VSCODE-CODEQL-STARTER/CODEQL-CUSTOM-QUERIES-JAVASCRIPT/EXAMPLE.QL" ,
280+ platform : "win32" ,
281+ expected : true ,
282+ } ,
283+ {
284+ parent :
285+ "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
286+ child :
263287 "D:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
264288 platform : "win32" ,
265289 expected : false ,
266290 } ,
267291 {
268- path1 :
292+ parent :
269293 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
270- path2 :
294+ child :
271295 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
272296 platform : "win32" ,
273297 expected : false ,
274298 } ,
275299 {
276- path1 :
300+ parent :
277301 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
278- path2 :
302+ child :
279303 "C:\\Users\\github\\projects\\vscode-codeql-starter\\codeql-custom-queries-javascript\\example.ql" ,
280304 platform : "win32" ,
281305 expected : true ,
282306 } ,
283307 {
284- path1 :
308+ parent :
285309 "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
286- path2 :
310+ child :
287311 "D:\\Users\\github\\projects\\vscode-codeql-starter\\codeql-custom-queries-javascript\\example.ql" ,
288312 platform : "win32" ,
289313 expected : false ,
290314 } ,
315+ {
316+ parent :
317+ "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-java" ,
318+ child :
319+ "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript" ,
320+ platform : "win32" ,
321+ expected : false ,
322+ } ,
323+ {
324+ parent :
325+ "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-java" ,
326+ child :
327+ "C:/Users/github/projects/vscode-codeql-starter/codeql-custom-queries-javascript/example.ql" ,
328+ platform : "win32" ,
329+ expected : false ,
330+ } ,
291331 ] ;
292332
293333 test . each ( testCases ) (
294- "$path1 contains $path2 on $platform = $expected" ,
295- ( { path1 , path2 , platform, expected } ) => {
334+ "$parent contains $child on $platform = $expected" ,
335+ ( { parent , child , platform, expected } ) => {
296336 if ( platform !== process . platform ) {
297337 // We're using the platform-specific path.resolve, so we can't really run
298338 // these tests on all platforms.
299339 return ;
300340 }
301341
302- expect ( containsPath ( path1 , path2 , platform ) ) . toEqual ( expected ) ;
342+ expect ( containsPath ( parent , child ) ) . toEqual ( expected ) ;
303343 } ,
304344 ) ;
305345} ) ;
0 commit comments