Test for no fail on unicode output

This commit is contained in:
mvoidex 2013-03-31 17:55:37 +04:00
parent f0eb792780
commit 653912a066
2 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,8 @@ import Expectation
import Info import Info
import Test.Hspec import Test.Hspec
import Types import Types
import System.Process
import System.Exit
spec :: Spec spec :: Spec
spec = do spec = do
@ -48,3 +50,7 @@ spec = do
cradle <- getGHCVersion >>= findCradle Nothing . fst cradle <- getGHCVersion >>= findCradle Nothing . fst
res <- infoExpr defaultOptions cradle "Main" "bar" "Main.hs" res <- infoExpr defaultOptions cradle "Main" "bar" "Main.hs"
res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`) res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`)
it "doesn't fail on unicode output" $ do
code <- rawSystem "dist/build/ghc-mod/ghc-mod" ["info", "test/data/Unicode.hs", "Unicode", "unicode"]
code `shouldSatisfy` (== ExitSuccess)

4
test/data/Unicode.hs Normal file
View File

@ -0,0 +1,4 @@
module Unicode where
unicode :: α -> α
unicode = id