Skip to content

Conversation

blaxill
Copy link

@blaxill blaxill commented Feb 23, 2023

This is covered by tests but it appears they are not functioning correctly- only single item lists are generated in test/HaskellWorks/Data/RankSelect/BitSeqSpec.hs. E.g. try printing bs under snoc test:

  it "(|>) should snoc" $ requireTest $ do
    b         <- forAll $ G.bool
    bs        <- forAll $ G.list (R.linear 1 1000) G.bool
    ps        <- forAll $ pure $ BS.fromBools bs

    liftIO $ print bs -- Only ever a single element

Using resize results in lists greater than 1 element and causes the test to fail (without this PR)

  it "(|>) should snoc" $ requireTest $ do
    b         <- forAll $ G.bool
    bs        <- forAll $ G.resize 100 $ G.list (R.linear 1 1000) G.bool
    ps        <- forAll $ pure $ BS.fromBools bs

    liftIO $ print bs -- Now many elements

I'm not sure on the correct fix for the tests as I am less familiar with hedgehog, but there seems to be some non obvious interaction with hedgehog 'Size'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants