@@ -42,6 +42,35 @@ final class PullDiagnosticsTests: XCTestCase {
4242    XCTAssertEqual ( diagnostic. range,  Position ( line:  1 ,  utf16index:  2 ) ..< Position ( line:  1 ,  utf16index:  9 ) ) 
4343  } 
4444
45+   func  testDiagnosticsIfFileIsOpenedWithLowercaseDriveLetter( )  async  throws  { 
46+     try SkipUnless . platformIsWindows ( " Drive letters only exist on Windows " ) 
47+ 
48+     let  fileContents  =  """ 
49+       func foo() { 
50+         invalid 
51+       } 
52+        """ 
53+ 
54+     // We use `IndexedSingleSwiftFileTestProject` so that the test file exists on disk, which causes sourcekitd to
55+     // uppercase the drive letter.
56+     let  project  =  try await  IndexedSingleSwiftFileTestProject ( fileContents,  allowBuildFailure:  true ) 
57+     project. testClient. send ( DidCloseTextDocumentNotification ( textDocument:  TextDocumentIdentifier ( project. fileURI) ) ) 
58+ 
59+     let  filePath  =  try XCTUnwrap ( project. fileURI. fileURL? . filePath) 
60+     XCTAssertEqual ( filePath [ filePath. index ( filePath. startIndex,  offsetBy:  1 ) ] ,  " : " ) 
61+     let  lowercaseDriveLetterPath  =  filePath. first!. lowercased ( )  +  filePath. dropFirst ( ) 
62+     let  uri  =  DocumentURI ( filePath:  lowercaseDriveLetterPath,  isDirectory:  false ) 
63+     project. testClient. openDocument ( fileContents,  uri:  uri) 
64+ 
65+     let  report  =  try await  project. testClient. send ( 
66+       DocumentDiagnosticsRequest ( textDocument:  TextDocumentIdentifier ( uri) ) 
67+     ) 
68+ 
69+     XCTAssertEqual ( report. fullReport? . items. count,  1 ) 
70+     let  diagnostic  =  try XCTUnwrap ( report. fullReport? . items. first) 
71+     XCTAssertEqual ( diagnostic. range,  Position ( line:  1 ,  utf16index:  2 ) ..< Position ( line:  1 ,  utf16index:  9 ) ) 
72+   } 
73+ 
4574  /// Test that we can get code actions for pulled diagnostics (https://github.com/swiftlang/sourcekit-lsp/issues/776)
4675  func  testCodeActions( )  async  throws  { 
4776    let  testClient  =  try await  TestSourceKitLSPClient ( 
0 commit comments