Permalink
Browse files

test unicode support (repl: +1, mueval: +0)

  • Loading branch information...
1 parent 228ff83 commit 9ea34bc80a92eb6aab44a974e333dcf206e1bccb @mikeplus64 committed Feb 5, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 Test.hs
View
11 Test.hs
@@ -1,5 +1,6 @@
import Language.Haskell.Repl
+(-->) :: a -> b -> (a,b)
(-->) = (,)
main :: IO ()
@@ -8,14 +9,20 @@ main = do
putStrLn "Started repl..."
let test label ts = do
putStrLn $ "--- " ++ label ++ " ---"
- mapM_ (\(l,x') -> do x <- prompt repl x'; putStr $ l ++ ": "; mapM_ putStrLn x) ts
+ mapM_
+ (\(l,x') -> do
+ x <- prompt repl x'
+ putStr $ l ++ ": "
+ mapM_ putStrLn x)
+ ts
test "Expressions"
[ "quickly return" --> "let x = 32 in x"
, "quickly consume a line" --> "[0..]"
, "time out" --> "forever (return ()) :: Maybe ()"
, "time out and show output" --> "[0,1,2,3,let x = x in x]"
, "complete quickly and error" --> "[0,1,2,3,error \"yikes\"]"
+ , "unicode string" --> "let (⧺) = (++) in \"aaaa\"\"私はバンゴホルーです。\" :: String"
]
test "Declarations"
@@ -26,10 +33,12 @@ main = do
, "instances" --> "instance Abc X X'"
, "let-bindings" --> "let x = X; x' = X' x"
, "normal binding (should fail)"--> "asdf = 31"
+ , "unicode let binding" --> "let あ = 'a'"
]
test "Types"
[ "x :: X" --> ":t x"
+ , ":t あ" --> ":t あ"
, "fmapfmapfmap" --> ":t fmap fmap fmap"
]

0 comments on commit 9ea34bc

Please sign in to comment.