Lysxia / test-monad-laws

QuickCheck properties for monad classes
MIT License
7 stars 1 forks source link

Non-minimal counterexamples #5

Open Lysxia opened 4 years ago

Lysxia commented 4 years ago

For example

stack test checkers-mtl --test-arguments="-p catch-bind-ses"

once in a while we get unnecessarily big counterexamples, like (Right (0,0), -10):

Tests
  MonadExcept
    Mutant
      catch-bind-ses: OK
        +++ OK, failed as expected. Falsifiable (after 12 tests and 38 shrinks):
        \a0 -> \a0 -> (Right (0,0),-10)
        \a0 -> \a0 -> \a0 -> (Left 0,0)
        \a0 -> \a0 -> case a0 :: Int of { 0 -> \a0 -> (Left 0,0) ; _ -> \a0 -> (Right (0,0),0) }
        1
        0
        (_, _) =? (_, _)   (1) ...
        Right _ /= Left _

It's an issue with how shrinking works in QuickCheck.