Skip to content

Commit

Permalink
Make stylish happy?
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed Jun 12, 2024
1 parent 4d7b8bd commit 17facb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions command-line/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ import System.IO (hSetEncoding, utf8, hPutStrLn, stderr, stdin, stdout)
import System.Win32.Console (setConsoleCP, setConsoleOutputCP, getConsoleCP, getConsoleOutputCP)
#endif

#ifdef mingw32_HOST_OS
initialize :: IO ()
initialize = do
#ifdef mingw32_HOST_OS
query getConsoleOutputCP (\e -> setConsoleOutputCP e >> hSetEncoding stdout utf8 >> hSetEncoding stderr utf8) utf8Code
query getConsoleCP (\e -> setConsoleCP e >> hSetEncoding stdin utf8) utf8Code
where
utf8Code = 65001
query get set expected = do
v <- get
if v == expected then pure () else set expected
#else
pure ()
#endif

main :: IO ()
main = do
ghcjsBuildSupport
#ifdef mingw32_HOST_OS
initialize
#endif
withUtf8 $ hspecWith defaultConfig AutoDiscover.spec

0 comments on commit 17facb8

Please sign in to comment.