File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/PowerShellEditorServices/Services/TextDocument
test/PowerShellEditorServices.Test/Session Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ internal static List<string> GetLinesInternal(string text)
217217 internal static bool IsUntitledPath ( string path )
218218 {
219219 Validate . IsNotNull ( nameof ( path ) , path ) ;
220- return string . Equals (
220+ return ! string . Equals (
221221 DocumentUri . From ( path ) . Scheme ,
222222 Uri . UriSchemeFile ,
223223 StringComparison . OrdinalIgnoreCase ) ;
Original file line number Diff line number Diff line change @@ -658,5 +658,17 @@ public void DocumentUriRetunsCorrectStringForAbsolutePath()
658658 Assert . Equal ( "file:///home/JamesHolden/projects/Rocinate/Proto%3AMole%5Ccule.ps1" , scriptFile . DocumentUri ) ;
659659 }
660660 }
661+
662+ [ Trait ( "Category" , "ScriptFile" ) ]
663+ [ Theory ]
664+ [ InlineData ( "C:\\ Users\\ me\\ Documents\\ test.ps1" , false ) ]
665+ [ InlineData ( "/Users/me/Documents/test.ps1" , false ) ]
666+ [ InlineData ( "vscode-notebook-cell:/Users/me/Documents/test.ps1#0001" , true ) ]
667+ [ InlineData ( "https://microsoft.com" , true ) ]
668+ [ InlineData ( "Untitled:Untitled-1" , true ) ]
669+ public void IsUntitledFileIsCorrect ( string path , bool expected )
670+ {
671+ Assert . Equal ( expected , ScriptFile . IsUntitledPath ( path ) ) ;
672+ }
661673 }
662674}
You can’t perform that action at this time.
0 commit comments