diff options
-rw-r--r-- | test/ArbitraryMove.hs | 2 | ||||
-rw-r--r-- | test/Test.hs | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/test/ArbitraryMove.hs b/test/ArbitraryMove.hs index df3d7fb..486eb36 100644 --- a/test/ArbitraryMove.hs +++ b/test/ArbitraryMove.hs @@ -56,8 +56,6 @@ instance Arbitrary PGN sensibleString = listOf $ choose ('a', 'z') - shrink pgn = [pgn {moves=ms} | ms <- shrink $ moves pgn] - {- This file can largely be generated with the following pipeline: - - grep -v '^\(\[\|$\)' \ diff --git a/test/Test.hs b/test/Test.hs index 897c788..032e125 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 @@ -114,5 +114,11 @@ prop_move_not_result_check = atAnyTwoStates (\b1 b2 -> Black -> not (check Black 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})) |