summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ArbitraryMove.hs2
-rw-r--r--test/Test.hs21
2 files changed, 13 insertions, 10 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 e112484..2d785e7 100644
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -13,6 +13,7 @@ import Data.Maybe
import Control.Monad
import Test.QuickCheck
+import Test.QuickCheck.Random
import Chess
import Chess.FEN
@@ -35,14 +36,17 @@ atAnyTwoStates ok pgn =
seqList [] _ = []
-prop_checkPGN :: PGN -> Bool
-prop_checkPGN pgn
- | isLeft parsed = False
- | length parsed' /= 1 = False
- | otherwise = pgn == ((head parsed') {initialPosition=Just defaultBoard})
+prop_checkPGN :: Property
+prop_checkPGN = withMaxSuccess 1000 test
where
- parsed = parseOnly pgnParser (pack $ pgnToString pgn)
- (Right parsed') = parsed
+ test :: PGN -> Bool
+ test pgn
+ | isLeft parsed = False
+ | length parsed' /= 1 = False
+ | otherwise = pgn == ((head parsed') {initialPosition=Just defaultBoard})
+ where
+ parsed = parseOnly pgnParser (pack $ pgnToString pgn)
+ (Right parsed') = parsed
pgnToString :: PGN -> String
pgnToString pgn = makePGN
@@ -116,4 +120,5 @@ prop_move_not_result_check = atAnyTwoStates (\b1 b2 ->
)
return []
-main = $forAllProperties (quickCheckWithResult (stdArgs {maxSuccess=10000}))
+main = $forAllProperties (quickCheckWithResult (stdArgs
+ {maxSuccess=100000, replay=Just (mkQCGen 37,0)}))