@@ -313,9 +313,8 @@ tag("medium").suite("ProjectPanelProvider Test Suite", function () {
313313 const dep = items . find ( n => n . name === "swift-markdown" ) as PackageNode ;
314314 expect ( dep , `${ JSON . stringify ( items , null , 2 ) } ` ) . to . not . be . undefined ;
315315 expect ( dep ?. location ) . to . equal ( "https://github.com/swiftlang/swift-markdown.git" ) ;
316- assertPathsEqual (
317- dep ?. path ,
318- path . join ( testAssetPath ( "targets" ) , ".build/checkouts/swift-markdown" )
316+ expect ( dep ?. path ) . to . equalPath (
317+ testAssetPath ( "targets/.build/checkouts/swift-markdown" )
319318 ) ;
320319 } ) ;
321320
@@ -326,8 +325,8 @@ tag("medium").suite("ProjectPanelProvider Test Suite", function () {
326325 dep ,
327326 `Expected to find defaultPackage, but instead items were ${ items . map ( n => n . name ) } `
328327 ) . to . not . be . undefined ;
329- assertPathsEqual ( dep ?. location , testAssetPath ( "defaultPackage" ) ) ;
330- assertPathsEqual ( dep ?. path , testAssetPath ( "defaultPackage" ) ) ;
328+ expect ( dep ?. location ) . to . equalPath ( testAssetPath ( "defaultPackage" ) ) ;
329+ expect ( dep ?. path ) . to . equalPath ( testAssetPath ( "defaultPackage" ) ) ;
331330 } ) ;
332331
333332 test ( "Lists local dependency file structure" , async ( ) => {
@@ -343,24 +342,22 @@ tag("medium").suite("ProjectPanelProvider Test Suite", function () {
343342 const folder = folders . find ( n => n . name === "Sources" ) as FileNode ;
344343 expect ( folder ) . to . not . be . undefined ;
345344
346- assertPathsEqual ( folder ?. path , path . join ( testAssetPath ( "defaultPackage" ) , " Sources") ) ;
345+ expect ( folder ?. path ) . to . equalPath ( testAssetPath ( "defaultPackage/ Sources" ) ) ;
347346
348347 const childFolders = await treeProvider . getChildren ( folder ) ;
349348 const childFolder = childFolders . find ( n => n . name === "PackageExe" ) as FileNode ;
350349 expect ( childFolder ) . to . not . be . undefined ;
351350
352- assertPathsEqual (
353- childFolder ?. path ,
354- path . join ( testAssetPath ( "defaultPackage" ) , "Sources/PackageExe" )
351+ expect ( childFolder ?. path ) . to . equalPath (
352+ testAssetPath ( "defaultPackage/Sources/PackageExe" )
355353 ) ;
356354
357355 const files = await treeProvider . getChildren ( childFolder ) ;
358356 const file = files . find ( n => n . name === "main.swift" ) as FileNode ;
359357 expect ( file ) . to . not . be . undefined ;
360358
361- assertPathsEqual (
362- file ?. path ,
363- path . join ( testAssetPath ( "defaultPackage" ) , "Sources/PackageExe/main.swift" )
359+ expect ( file ?. path ) . to . equalPath (
360+ testAssetPath ( "defaultPackage/Sources/PackageExe/main.swift" )
364361 ) ;
365362 } ) ;
366363
@@ -375,19 +372,19 @@ tag("medium").suite("ProjectPanelProvider Test Suite", function () {
375372 expect ( folder ) . to . not . be . undefined ;
376373
377374 const depPath = path . join ( testAssetPath ( "targets" ) , ".build/checkouts/swift-markdown" ) ;
378- assertPathsEqual ( folder ?. path , path . join ( depPath , "Sources" ) ) ;
375+ expect ( folder ?. path ) . to . equalPath ( path . join ( depPath , "Sources" ) ) ;
379376
380377 const childFolders = await treeProvider . getChildren ( folder ) ;
381378 const childFolder = childFolders . find ( n => n . name === "CAtomic" ) as FileNode ;
382379 expect ( childFolder ) . to . not . be . undefined ;
383380
384- assertPathsEqual ( childFolder ?. path , path . join ( depPath , "Sources/CAtomic" ) ) ;
381+ expect ( childFolder ?. path ) . to . equalPath ( path . join ( depPath , "Sources/CAtomic" ) ) ;
385382
386383 const files = await treeProvider . getChildren ( childFolder ) ;
387384 const file = files . find ( n => n . name === "CAtomic.c" ) as FileNode ;
388385 expect ( file ) . to . not . be . undefined ;
389386
390- assertPathsEqual ( file ?. path , path . join ( depPath , "Sources/CAtomic/CAtomic.c" ) ) ;
387+ expect ( file ?. path ) . to . equalPath ( path . join ( depPath , "Sources/CAtomic/CAtomic.c" ) ) ;
391388 } ) ;
392389
393390 test ( "Shows a flat dependency list" , async ( ) => {
@@ -501,11 +498,4 @@ tag("medium").suite("ProjectPanelProvider Test Suite", function () {
501498 throw error ;
502499 }
503500 }
504-
505- function assertPathsEqual ( path1 : string | undefined , path2 : string | undefined ) {
506- expect ( path1 ) . to . not . be . undefined ;
507- expect ( path2 ) . to . not . be . undefined ;
508- // Convert to vscode.Uri to normalize paths, including drive letter capitalization on Windows.
509- expect ( vscode . Uri . file ( path1 ! ) . fsPath ) . to . equal ( vscode . Uri . file ( path2 ! ) . fsPath ) ;
510- }
511501} ) ;
0 commit comments