diff options
author | Camil Staps | 2017-11-22 16:36:00 +0100 |
---|---|---|
committer | Camil Staps | 2017-11-22 16:36:00 +0100 |
commit | 4707c68955ec0d9e38e7b5430c7100434c2334e0 (patch) | |
tree | 94bbb3176dcd6b21131eebb755776e9fe0c2c298 /test/Test.hs | |
parent | Don't shrink test cases; this always reduces to the moves '' which gives a ru... (diff) |
Add prop_dont_touch_my_pieces
Diffstat (limited to 'test/Test.hs')
-rw-r--r-- | test/Test.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/Test.hs b/test/Test.hs index f8a8729..f451c75 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -5,8 +5,8 @@ module Test where import Data.Array import Data.Attoparsec.ByteString.Char8 import Data.ByteString.Char8 (pack) - import Data.Either +import Data.Function import Data.List import Data.Maybe @@ -107,5 +107,11 @@ prop_not_in_check_twice = atAnyTwoStates (\b1 b2 -> not (check Black b1 && check Black b2) && not (check White b1 && check White b2)) +prop_dont_touch_my_pieces :: PGN -> Bool +prop_dont_touch_my_pieces = atAnyTwoStates (\b1 b2 -> notMoved (turn b2) b1 b2) + where + notMoved :: Color -> Board -> Board -> Bool + notMoved c = (==) `on` pieceCoords (Just c) Nothing + return [] main = $forAllProperties (quickCheckWithResult (stdArgs {maxSuccess=10000})) |