File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed
quickcheck-dynamic/src/Test/QuickCheck Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,8 @@ prettyWitnesses Do{} = []
297
297
instance StateModel s => Show (DynLogicTest s ) where
298
298
show (BadPrecondition is ss bad s) =
299
299
" -- Initial state: "
300
- ++ show is
300
+ ++ show s
301
+ ++ " \n "
301
302
++ prettyTestSequence (usedVariables is ss <> allVariables bad) ss
302
303
++ " \n -- In state: "
303
304
++ show s
@@ -312,21 +313,17 @@ instance StateModel s => Show (DynLogicTest s) where
312
313
| p == PosPolarity = " action"
313
314
| otherwise = " failingAction"
314
315
show (Looping is ss) =
315
- " -- Initial state: "
316
- ++ show is
317
- ++ prettyTestSequence (usedVariables is ss) ss
318
- ++ " \n pure ()\n -- Looping"
316
+ showTest is ss
317
+ ++ " \n -- Looping"
319
318
show (Stuck is ss s) =
320
- " -- Initial state: "
321
- ++ show is
322
- ++ prettyTestSequence (usedVariables is ss) ss
323
- ++ " \n pure ()\n -- Stuck in state "
319
+ showTest is ss
320
+ ++ " \n -- Stuck in state "
324
321
++ show s
325
322
show (DLScript is ss) =
326
- " -- Initial state: "
327
- ++ show is
328
- ++ prettyTestSequence (usedVariables is ss) ss
329
- ++ " \n pure () \n "
323
+ showTest is ss
324
+
325
+ showTest :: StateModel s => Annotated s -> TestSequence s -> String
326
+ showTest is ss = " -- Initial state: " ++ show is ++ " \n " ++ prettyTestSequence (usedVariables is ss) ss ++ " \n pure () "
330
327
331
328
usedVariables :: forall s . StateModel s => Annotated s -> TestSequence s -> VarContext
332
329
usedVariables s = go s
Original file line number Diff line number Diff line change @@ -328,7 +328,11 @@ instance Eq (Step state) where
328
328
-- We also collect a list of names of actions which were generated,
329
329
-- but were then rejected by their precondition.
330
330
331
- data Actions state = Actions_ [String ] state (Smart [Step state ])
331
+ data Actions state = Actions_
332
+ { actionsRejected :: [String ]
333
+ , actionsInitialState :: state
334
+ , actionsSteps :: Smart [Step state ]
335
+ }
332
336
deriving (Generic )
333
337
334
338
pattern Actions :: state -> [Step state ] -> Actions state
You can’t perform that action at this time.
0 commit comments