From 13d7f0c9487f8e9fda89a835a9acc8eb2231774a Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Thu, 19 Sep 2019 12:06:50 -0400 Subject: [PATCH] add test for consLength32BE --- test/Main.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Main.hs b/test/Main.hs index 19ef7b7..c2ab6e0 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -7,7 +7,7 @@ import Control.Monad.ST (runST) import Data.Bytes.Types (MutableBytes(..)) import Data.ByteArray.Builder import Data.Word -import Data.Char (ord) +import Data.Char (ord,chr) import Data.Primitive (ByteArray) import Test.Tasty (defaultMain,testGroup,TestTree) import Test.QuickCheck ((===)) @@ -57,6 +57,10 @@ tests = testGroup "Tests" run 1 (word8Dec w) === pack (show w) + , TQC.testProperty "consLength32BE" $ \w -> + run 1 (consLength32BE (word8Dec w)) + === + pack ('\x00' : '\x00' : '\x00' : chr (L.length (show w)) : show w) , TQC.testProperty "pasteArrayST" $ \(xs :: [Word64]) -> (runArray word64Dec (V.fromList xs)) ===