File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ main :: AlmostEff
8
8
main = do
9
9
testNumberShow show
10
10
testOrderings
11
+ testOrdUtils
11
12
testIntDegree
12
13
13
14
foreign import testNumberShow :: (Number -> String ) -> AlmostEff
@@ -72,6 +73,15 @@ testOrderings = do
72
73
testOrd [1 , 1 ] [1 , 0 ] GT
73
74
testOrd [1 , -1 ] [1 , 0 ] LT
74
75
76
+ testOrdUtils :: AlmostEff
77
+ testOrdUtils = do
78
+ assert " -5 clamped between 0 and 10 should be 0" $ clamp 0 10 (-5 ) == 0
79
+ assert " 5 clamped between 0 and 10 should be 5" $ clamp 0 10 5 == 5
80
+ assert " 15 clamped between 0 and 10 should be 10" $ clamp 0 10 15 == 10
81
+ assert " -5 should not be between 0 and 10" $ between 0 10 (-5 ) == false
82
+ assert " 5 should be between 0 and 10" $ between 0 10 5 == true
83
+ assert " 15 should not be between 0 10" $ between 0 10 15 == false
84
+
75
85
testIntDegree :: AlmostEff
76
86
testIntDegree = do
77
87
let bot = bottom :: Int
You can’t perform that action at this time.
0 commit comments