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
88main = do
99 testNumberShow show
1010 testOrderings
11+ testOrdUtils
1112 testIntDegree
1213
1314foreign import testNumberShow :: (Number -> String ) -> AlmostEff
@@ -72,6 +73,15 @@ testOrderings = do
7273 testOrd [1 , 1 ] [1 , 0 ] GT
7374 testOrd [1 , -1 ] [1 , 0 ] LT
7475
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+
7585testIntDegree :: AlmostEff
7686testIntDegree = do
7787 let bot = bottom :: Int
You can’t perform that action at this time.
0 commit comments