Skip to content

Commit 5369244

Browse files
committed
Try force language server to use utf8 locale
1 parent d83e651 commit 5369244

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

test/functional/Eval.hs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Language.Haskell.LSP.Test
1414
import Language.Haskell.LSP.Types (ApplyWorkspaceEditRequest, CodeLens (CodeLens, _command, _range),
1515
Command (_title),
1616
Position (..), Range (..))
17+
import System.Environment
1718
import System.FilePath
1819
import Test.Hls.Util
1920
import Test.Tasty
@@ -93,14 +94,17 @@ tests = testGroup
9394
]
9495

9596
goldenTest :: FilePath -> IO ()
96-
goldenTest input = runSession hlsCommand fullCaps evalPath $ do
97-
doc <- openDoc input "haskell"
98-
[CodeLens { _command = Just c }] <- getCodeLenses doc
99-
executeCommand c
100-
_resp :: ApplyWorkspaceEditRequest <- skipManyTill anyMessage message
101-
edited <- documentContents doc
102-
expected <- liftIO $ T.readFile $ evalPath </> input <.> "expected"
103-
liftIO $ edited @?= expected
97+
goldenTest input = do
98+
getEnv "LANG" >>= print
99+
setEnv "LANG" "en_US.UTF-8"
100+
runSession hlsCommand fullCaps evalPath $ do
101+
doc <- openDoc input "haskell"
102+
[CodeLens { _command = Just c }] <- getCodeLenses doc
103+
executeCommand c
104+
_resp :: ApplyWorkspaceEditRequest <- skipManyTill anyMessage message
105+
edited <- documentContents doc
106+
expected <- liftIO $ T.readFile $ evalPath </> input <.> "expected"
107+
liftIO $ edited @?= expected
104108

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

0 commit comments

Comments
 (0)