unicode-show 0.1.0.2 → 0.1.0.3
raw patch · 3 files changed
+19/−17 lines, 3 filesnew-uploader
Files
- src/Text/Show/Unicode.hs +2/−3
- test/Spec.hs +12/−9
- unicode-show.cabal +5/−5
src/Text/Show/Unicode.hs view
@@ -1,7 +1,7 @@ {- | Copyright : (c) Takayuki Muranushi, 2016-License : MIT-Maintainer : muranushi@gmail.com+License : BSD3+Maintainer : whosekiteneverfly@gmail.com Stability : experimental @@ -51,7 +51,6 @@ module Text.Show.Unicode (ushow, uprint, ushowWith, uprintWith) where import Control.Applicative ((<$>), (<$), (<|>))-import GHC.Show (showLitChar) import GHC.Read (readLitChar) import Data.Char(isPrint) import Text.ParserCombinators.ReadP
test/Spec.hs view
@@ -10,11 +10,7 @@ import Text.Show.Unicode data T試6験 = Å4 { すけろく :: String} deriving (Eq, Ord, Show, Read)-data T試7験 = String :\& String deriving (Eq, Ord, Show, Read)---- Derived instance of Read and Show produced by GHC--- does not satisfy Haskell 2010 spec, for the moment (ghc 7.10.3).--- Therefore, we must regretfully skip this test.+data T試7験 = String :@\& String deriving (Eq, Ord, Show, Read) data T試8験 = String :@\& String deriving (Eq, Ord, Show, Read) @@ -36,17 +32,24 @@ , testGroup "read . ushow == id" [ testProperty "read . ushow == id, for String" $ \str -> read (ushow str) == (str :: String)+ , testProperty "read . ushow == id, for Char" $+ \x -> read (ushow x) == (x :: Char)+ , testProperty "read . ushow == id, for [(Char,())]" $+ \x -> read (ushow x) == (x :: [(Char,())]) , testProperty "read . read . ushow . ushow == id, for String" $ \str -> (read $ read $ ushow $ ushow str) == (str :: String) , testProperty "read . ushow == id, for some crazy Unicode type" $ \str -> let v = Å4 str in read (ushow v) == v , testProperty "read . ushow == id, for some crazy Unicode type" $- \a b -> let v = a :\& b in read (ushow v) == v--- , testProperty "read . ushow == id, for some crazy Unicode type" $--- \a b -> let v = a :@\& b in read (show v) == v+ \a b -> let v = a :@\& b in read (ushow v) == v+ , testProperty "read . ushow == id, for some crazy Unicode type" $+ \a b -> let v = a :@\& b in read (show v) == v , testProperty "read . ushow == id, for compound type" $ \str -> read (ushow str) == (str :: Either [String] (String,String)) ] ] main :: IO ()-main = defaultMain tests+main = do+ print $ "hoge" :@\& "huga"+ putStrLn $ ushow $ "hoge" :@\& "huga"+ defaultMain tests
unicode-show.cabal view
@@ -1,21 +1,21 @@ name: unicode-show-version: 0.1.0.2+version: 0.1.0.3 synopsis: print and show in unicode description: This package provides variants of 'show' and 'print' functions that does not escape non-ascii characters. .- See <http://github.com/nushio3/unicode-show#readme README> for usage.+ See <http://github.com/haskell-jp/unicode-show#readme README> for usage. . Run ghci with @-interactive-print@ flag to print unicode characters. See <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/interactive-evaluation.html#ghci-interactive-print Using a custom interactive printing function> section in the GHC manual. -homepage: http://github.com/nushio3/unicode-show#readme+homepage: http://github.com/haskell-jp/unicode-show#readme license: BSD3 license-file: LICENSE author: Takayuki Muranushi-maintainer: muranushi@gmail.com+maintainer: whosekiteneverfly@gmail.com copyright: 2016 Takayuki Muranushi category: Text build-type: Simple@@ -45,4 +45,4 @@ source-repository head type: git- location: https://github.com/nushio3/unicode-show+ location: https://github.com/haskell-jp/unicode-show