module Main (main) where
import Test.Hspec
import Test.Hspec.QuickCheck
import Data.MessagePack as MP
import Graphics.Text.Font.Choose
main :: IO ()
main = hspec $ do
describe "Canary" $ do
it "runs fine" $ do
True `shouldBe` True
describe "Roundtrips" $ do
describe "converts MessagePack & back" $ do
prop "CharSet" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: CharSet')
prop "FontSet" $ \x -> let y = Prelude.map unPattern x
in MP.unpack (MP.pack y) `shouldBe` Just y
prop "LangSet" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: LangSet')
prop "ObjectSet" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: ObjectSet)
prop "Pattern" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: Pattern')
prop "Range" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: Range)
prop "StrSet" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: StrSet)
prop "Value" $ \x ->
MP.unpack (MP.pack x) `shouldBe` Just (x :: Value)