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)
217
217
internal static bool IsUntitledPath ( string path )
218
218
{
219
219
Validate . IsNotNull ( nameof ( path ) , path ) ;
220
- return string . Equals (
220
+ return ! string . Equals (
221
221
DocumentUri . From ( path ) . Scheme ,
222
222
Uri . UriSchemeFile ,
223
223
StringComparison . OrdinalIgnoreCase ) ;
Original file line number Diff line number Diff line change @@ -658,5 +658,17 @@ public void DocumentUriRetunsCorrectStringForAbsolutePath()
658
658
Assert . Equal ( "file:///home/JamesHolden/projects/Rocinate/Proto%3AMole%5Ccule.ps1" , scriptFile . DocumentUri ) ;
659
659
}
660
660
}
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
+ }
661
673
}
662
674
}
You can’t perform that action at this time.
0 commit comments