Тесты для первой функции

This commit is contained in:
2024-11-29 19:26:04 +03:00
parent 1aa359b5c1
commit 7ccdb8346e
3 changed files with 22 additions and 2 deletions

View File

@@ -1,2 +1,20 @@
import Test.QuickCheck
import Lib (isCongruent)
propCongruentDifference :: Int -> Int -> Int -> Property
propCongruentDifference a b m =
m /= 0 ==> isCongruent a b m == ((a - b) `mod` m == 0)
propCongruentSymmetric :: Int -> Int -> Int -> Property
propCongruentSymmetric a b m =
m /= 0 ==> isCongruent a b m == isCongruent b a m
propCongruentEqualNumbers :: Int -> Int -> Property
propCongruentEqualNumbers a m =
m /= 0 ==> isCongruent a a m == True
main :: IO ()
main = putStrLn "Test suite not yet implemented"
main = do
quickCheck propCongruentDifference
quickCheck propCongruentSymmetric
quickCheck propCongruentEqualNumbers