Skip to content

Difference between forAllQ and forAllNonVariableQ? #66

@ch1bo

Description

@ch1bo

Is shrinking different? What is the difference?

Maybe this is also a bug report on shrinking behavior.

We are sometimes generating actions in DL like this:

  -- seed world
  forAllQ (withGenQ genSeed (const [])) >>= action_
  -- init head
  WorldState{hydraParties} <- getModelStateDL
  forAllQ (withGenQ (genInit hydraParties) (const [])) >>= action_

which when failing, shrinks in a way it invalidates a pre-condition, e.g.

Falsified (after 1 test and 1 shrink):
         do _ <- forAllQ $ exactlyQ $ Init (Party {vkey = HydraVerificationKey (VerKeyEd25519DSIGN "55517edd313790d7ac8140e12c783847fad49f9f7b242d385423db7b9ff2443d")})
            -- In state: [] |- WorldState {hydraParties = [], hydraState = Start}
            action $ Init (Party {vkey = HydraVerificationKey (VerKeyEd25519DSIGN "55517edd313790d7ac8140e12c783847fad49f9f7b242d385423db7b9ff2443d")})  -- Failed precondition
            pure ()

(If I run this with max shrinks 0 it shows the actually failing model / perform).

However, when exchanging the first forAllQ with forAllNonVariableQ this does not fail on precondition when shrinking (supposedly, given the test output saying "1 test and 1 shrink").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions