From 69723be05c315ab0068a567ec6baa4763ada0057 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Mon, 1 Jun 2015 10:46:59 +0100 Subject: [PATCH] [tests] add the reverse of the previous number kat test --- tests/Number.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Number.hs b/tests/Number.hs index 78b81f7..5510db2 100644 --- a/tests/Number.hs +++ b/tests/Number.hs @@ -51,7 +51,9 @@ tests = testGroup "number" in bits == numBits prime || (if baseBits < 64 then (bits + 1) == numBits prime else False) , testProperty "marshalling" $ \qaInt -> getQAInteger qaInt == os2ip (i2osp (getQAInteger qaInt) :: Bytes) - , testGroup "serialization-kat" $ map toSerializationKat $ zip [katZero..] serializationVectors + , testGroup "marshalling-kat-to-bytearray" $ map toSerializationKat $ zip [katZero..] serializationVectors + , testGroup "marshalling-kat-to-integer" $ map toSerializationKatInteger $ zip [katZero..] serializationVectors ] where toSerializationKat (i, (sz, n, ba)) = testCase (show i) (ba @=? i2ospOf_ sz n) + toSerializationKatInteger (i, (_, n, ba)) = testCase (show i) (n @=? os2ip ba)