@@ -352,6 +352,23 @@ public async Task TestOpenDocumentWithInvalidUri(bool mutatingLspWorkspace, stri
352352 Assert . Equal ( "hello" , ( await document ! . GetTextAsync ( ) ) . ToString ( ) ) ;
353353 }
354354
355+ [ Theory ]
356+ [ InlineData ( true , null , null ) ]
357+ [ InlineData ( false , "file://c:\\ valid" , null ) ]
358+ [ InlineData ( false , null , "file://c:\\ valid" ) ]
359+ [ InlineData ( true , "file://c:\\ valid" , "file://c:\\ valid" ) ]
360+ [ InlineData ( true , "file://c:\\ valid" , "file:///c:/valid" ) ]
361+ [ InlineData ( true , "file://c:\\ valid" , "file://c:\\ VALID" ) ]
362+ [ InlineData ( false , "file://c:\\ valid" , "file://c:\\ valid2" ) ]
363+ public void TestUriEquality ( bool areEqual , string ? uriString1 , string ? uriString2 )
364+ {
365+ var documentUri1 = uriString1 != null ? new DocumentUri ( uriString1 ) : null ;
366+ var documentUri2 = uriString2 != null ? new DocumentUri ( uriString2 ) : null ;
367+
368+ Assert . True ( areEqual == ( documentUri1 == documentUri2 ) ) ;
369+ Assert . True ( areEqual != ( documentUri1 != documentUri2 ) ) ;
370+ }
371+
355372 private sealed record class ResolvedDocumentInfo ( string WorkspaceKind , string ProjectLanguage ) ;
356373 private sealed record class CustomResolveParams ( [ property: JsonPropertyName ( "textDocument" ) ] LSP . TextDocumentIdentifier TextDocument ) ;
357374
0 commit comments