@@ -19,6 +19,7 @@ import Database.LSMTree.Internal.Entry
1919import Database.LSMTree.Internal.PageAcc (entryWouldFitInPage ,
2020 sizeofEntry )
2121import Database.LSMTree.Internal.RawBytes (RawBytes (.. ))
22+ import qualified Database.LSMTree.Internal.RawBytes as RB
2223import Database.LSMTree.Internal.Serialise
2324
2425import qualified Test.QuickCheck as QC
@@ -42,12 +43,16 @@ tests = testGroup "Test.Database.LSMTree.Generators" [
4243 , testGroup " Chunk size" $
4344 prop_arbitraryAndShrinkPreserveInvariant noTags
4445 chunkSizeInvariant
45- , testGroup " Raw bytes " $
46+ , testGroup " RawBytes " $
4647 [ testProperty " packRawBytesPinnedOrUnpinned"
4748 prop_packRawBytesPinnedOrUnpinned
4849 ]
49- ++ prop_arbitraryAndShrinkPreserveInvariant noTags
50+ ++ prop_arbitraryAndShrinkPreserveInvariant labelRawBytes
5051 (deepseqInvariant @ RawBytes )
52+ , testGroup " LargeRawBytes" $
53+ prop_arbitraryAndShrinkPreserveInvariant
54+ (\ (LargeRawBytes rb) -> labelRawBytes rb)
55+ (deepseqInvariant @ LargeRawBytes )
5156 , testGroup " KeyForIndexCompact" $
5257 prop_arbitraryAndShrinkPreserveInvariant noTags $
5358 isKeyForIndexCompact . getKeyForIndexCompact
@@ -63,6 +68,10 @@ prop_packRawBytesPinnedOrUnpinned :: Bool -> [Word8] -> Bool
6368prop_packRawBytesPinnedOrUnpinned pinned ws =
6469 packRawBytesPinnedOrUnpinned pinned ws == RawBytes (VP. fromList ws)
6570
71+ labelRawBytes :: RawBytes -> Property -> Property
72+ labelRawBytes rb =
73+ QC. tabulate " size" [showPowersOf 2 (RB. size rb)]
74+
6675type TestEntry = Entry SerialisedValue BlobSpan
6776type TestKOp = (BiasedKeyForIndexCompact , TestEntry )
6877
0 commit comments