Skip to content

HashMap trees generated in property tests are too flat and too small #438

@sjakobi

Description

@sjakobi

-- Key type that generates more hash collisions.
newtype Key = K { unK :: Int }
deriving (Arbitrary, Eq, Ord, Show)
instance Hashable Key where
hashWithSalt salt k = hashWithSalt salt (unK k) `mod` 20

This hash function produces only values in the range [0..19]. As a result, a typical generated tree will have a BitmapIndexed root node that contains some Leafs and some Collisions. No Full nodes at all, and no internal/non-root BitmapIndexed nodes!

It seems very likely that some code added since #317 hasn't been tested at all. :/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions