[commit: packages/binary] master: Add tests for 8-bt word/ints (f0567f8)

git at git.haskell.org git at git.haskell.org
Tue Feb 2 21:04:24 UTC 2016


Repository : ssh://git@git.haskell.org/binary

On branch  : master
Link       : http://git.haskell.org/packages/binary.git/commitdiff/f0567f8917a3450df8b7abba676a5c1c52dd143c

>---------------------------------------------------------------

commit f0567f8917a3450df8b7abba676a5c1c52dd143c
Author: Alexey Khudyakov <alexey.skladnoy at gmail.com>
Date:   Sun Feb 9 15:53:06 2014 +0400

    Add tests for 8-bt word/ints


>---------------------------------------------------------------

f0567f8917a3450df8b7abba676a5c1c52dd143c
 tests/QC.hs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/QC.hs b/tests/QC.hs
index 0b3585d..ff4d37c 100644
--- a/tests/QC.hs
+++ b/tests/QC.hs
@@ -64,6 +64,9 @@ mustThrowError a = unsafePerformIO $
 --
 -- Words
 
+prop_Word8 :: Word8 -> Property
+prop_Word8 = roundTripWith putWord8 getWord8
+
 prop_Word16be :: Word16 -> Property
 prop_Word16be = roundTripWith putWord16be getWord16be
 
@@ -96,6 +99,9 @@ prop_Wordhost = roundTripWith putWordhost getWordhost
 
 -- Ints
 
+prop_Int8 :: Int8 -> Property
+prop_Int8 = roundTripWith putInt8 getInt8
+
 prop_Int16be :: Int16 -> Property
 prop_Int16be = roundTripWith putInt16be getInt16be
 
@@ -442,7 +448,8 @@ tests =
             ]
 
         , testGroup "Primitives"
-            [ testProperty "Word16be"   (p prop_Word16be)
+            [ testProperty "Word8"      (p prop_Word8)
+            , testProperty "Word16be"   (p prop_Word16be)
             , testProperty "Word16le"   (p prop_Word16le)
             , testProperty "Word16host" (p prop_Word16host)
             , testProperty "Word32be"   (p prop_Word32be)
@@ -453,6 +460,7 @@ tests =
             , testProperty "Word64host" (p prop_Word64host)
             , testProperty "Wordhost"   (p prop_Wordhost)
               -- Int
+            , testProperty "Int8"       (p prop_Int8)
             , testProperty "Int16be"    (p prop_Int16be)
             , testProperty "Int16le"    (p prop_Int16le)
             , testProperty "Int16host"  (p prop_Int16host)



More information about the ghc-commits mailing list