nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
713 stars 119 forks source link

property consistently throws Test.QuickCheck.resize: negative size error #342

Closed StevenXL closed 2 years ago

StevenXL commented 2 years ago

After updating my project from lts-19.1 to lts-19.3, one of my spec keeps throwing a Test.QuickCheck.resize: negative size error:

  describe "MathAnswer (MathAnswer Database Representation)" $ do
    it "has coherent ToJSON / FromJSON instances" $ property $ \mathAnswer ->
      decode (encode @MathAnswer mathAnswer) `shouldBe` Just mathAnswer

I understand that resize throwing on negative size was introduced in 2015 in order to highlight incorrect generators, but the test above does not use a custom generator.

I've checked the list of dependencies for quickcheck and none of them changed between the snapshots that I am using, but here is the output of stack ls dependencies.

The good news is that this does happen consistently.

prikhi commented 2 years ago

@StevenXL were you able to resolve this? I'm seeing the same errors with LTS 19.5

StevenXL commented 2 years ago

@StevenXL were you able to resolve this? I'm seeing the same errors with LTS 19.5

Hi @prikhi. It turns out that this was a problem with the generic-arbitrary library, not quickcheck itself.