@@ -31,6 +31,7 @@ import Language.Haskell.LSP.Messages
3131import Language.Haskell.LSP.Types
3232import Language.Haskell.LSP.Types.Capabilities
3333import Language.Haskell.LSP.VFS (applyChange)
34+import Network.URI
3435import System.Environment.Blank (setEnv)
3536import System.FilePath
3637import System.IO.Extra
@@ -2110,6 +2111,13 @@ unitTests = do
21102111 uriToFilePath' (fromNormalizedUri $ filePathToUri' "") @?= Just "."
21112112 , testCase "empty file path works using toNormalizedFilePath'" $
21122113 uriToFilePath' (fromNormalizedUri $ filePathToUri' (toNormalizedFilePath' "")) @?= Just ""
2114+ , testCase "empty path URI" $ do
2115+ Just URI{..} <- pure $ parseURI (T.unpack $ getUri $ fromNormalizedUri emptyPathUri)
2116+ uriScheme @?= "file:"
2117+ uriPath @?= ""
2118+ , testCase "from empty path URI" $ do
2119+ let uri = Uri "file://"
2120+ uriToFilePath' uri @?= Just ""
21132121 ]
21142122
21152123-- | Wrapper around 'LSPTest.openDoc'' that sends file creation events