Skip to content
Snippets Groups Projects
Commit b125c753 authored by kristenk's avatar kristenk
Browse files

Add solver quickcheck test

parent 61fb6fad
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,14 @@ tests = [
ReverseOrder -> reverse targets
in counterexample (showResults r1 r2) $
isJust (resultPlan r1) === isJust (resultPlan r2)
, testProperty
"solvable without --independent-goals => solvable with --independent-goals" $
\(SolverTest db targets) reorderGoals solver ->
let r1 = solve reorderGoals (IndepGoals False) solver targets db
r2 = solve reorderGoals (IndepGoals True) solver targets db
in counterexample (showResults r1 r2) $
isJust (resultPlan r1) `implies` isJust (resultPlan r2)
]
where
showResults :: Result -> Result -> String
......@@ -53,6 +61,9 @@ tests = [
++ resultLog result
++ ["result: " ++ show (resultPlan result)]
implies :: Bool -> Bool -> Bool
implies x y = not x || y
solve :: ReorderGoals -> IndepGoals -> Solver -> [PN] -> TestDb -> Result
solve reorder indep solver targets (TestDb db) =
let (lg, result) =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment