Skip to content

Commit

Permalink
Try force language server to use utf8 locale
Browse files Browse the repository at this point in the history
  • Loading branch information
lukel97 committed Oct 17, 2020
1 parent d83e651 commit 5369244
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/functional/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Types (ApplyWorkspaceEditRequest, CodeLens (CodeLens, _command, _range),
Command (_title),
Position (..), Range (..))
import System.Environment
import System.FilePath
import Test.Hls.Util
import Test.Tasty
Expand Down Expand Up @@ -93,14 +94,17 @@ tests = testGroup
]

goldenTest :: FilePath -> IO ()
goldenTest input = runSession hlsCommand fullCaps evalPath $ do
doc <- openDoc input "haskell"
[CodeLens { _command = Just c }] <- getCodeLenses doc
executeCommand c
_resp :: ApplyWorkspaceEditRequest <- skipManyTill anyMessage message
edited <- documentContents doc
expected <- liftIO $ T.readFile $ evalPath </> input <.> "expected"
liftIO $ edited @?= expected
goldenTest input = do
getEnv "LANG" >>= print
setEnv "LANG" "en_US.UTF-8"
runSession hlsCommand fullCaps evalPath $ do
doc <- openDoc input "haskell"
[CodeLens { _command = Just c }] <- getCodeLenses doc
executeCommand c
_resp :: ApplyWorkspaceEditRequest <- skipManyTill anyMessage message
edited <- documentContents doc
expected <- liftIO $ T.readFile $ evalPath </> input <.> "expected"
liftIO $ edited @?= expected

evalPath :: FilePath
evalPath = "test/testdata/eval"

0 comments on commit 5369244

Please sign in to comment.