diff options
Diffstat (limited to 'test/Test.hs')
-rw-r--r-- | test/Test.hs | 21 |
1 files changed, 13 insertions, 8 deletions
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)})) |