@@ -547,7 +547,6 @@ public void PropertiesInitializedCorrectlyForFile()
547
547
548
548
Assert . Equal ( path , scriptFile . FilePath ) ;
549
549
Assert . Equal ( path , scriptFile . ClientFilePath ) ;
550
- Assert . Equal ( "file:///TestFile.ps1" , scriptFile . DocumentUri ) ;
551
550
Assert . True ( scriptFile . IsAnalysisEnabled ) ;
552
551
Assert . False ( scriptFile . IsInMemory ) ;
553
552
Assert . Empty ( scriptFile . ReferencedFiles ) ;
@@ -590,13 +589,19 @@ public void DocumentUriRetunsCorrectStringForAbsolutePath()
590
589
ScriptFile scriptFile ;
591
590
var emptyStringReader = new StringReader ( "" ) ;
592
591
593
- path = @"C:\Users\AmosBurton\projects\Rocinate\ProtoMolecule.ps1" ;
594
- scriptFile = new ScriptFile ( path , path , emptyStringReader , PowerShellVersion ) ;
595
- Assert . Equal ( "file:///c%3A/Users/AmosBurton/projects/Rocinate/ProtoMolecule.ps1" , scriptFile . DocumentUri ) ;
596
-
597
- if ( Environment . OSVersion . Platform == PlatformID . Unix )
592
+ if ( Environment . OSVersion . Platform == PlatformID . Win32NT )
593
+ {
594
+ path = @"C:\Users\AmosBurton\projects\Rocinate\ProtoMolecule.ps1" ;
595
+ scriptFile = new ScriptFile ( path , path , emptyStringReader , PowerShellVersion ) ;
596
+ Assert . Equal ( "file:///c%3A/Users/AmosBurton/projects/Rocinate/ProtoMolecule.ps1" , scriptFile . DocumentUri ) ;
597
+ }
598
+ else
598
599
{
599
600
// Test the following only on Linux and macOS.
601
+ path = "/home/AmosBurton/projects/Rocinate/ProtoMolecule.ps1" ;
602
+ scriptFile = new ScriptFile ( path , path , emptyStringReader , PowerShellVersion ) ;
603
+ Assert . Equal ( "file:///home/AmosBurton/projects/Rocinate/ProtoMolecule.ps1" , scriptFile . DocumentUri ) ;
604
+
600
605
path = "/home/AmosBurton/projects/Rocinate/Proto:Mole:cule.ps1" ;
601
606
scriptFile = new ScriptFile ( path , path , emptyStringReader , PowerShellVersion ) ;
602
607
Assert . Equal ( "file:///home/AmosBurton/projects/Rocinate/Proto%3AMole%3Acule.ps1" , scriptFile . DocumentUri ) ;
0 commit comments