mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
Set 10a Ex 4: new exercise
This commit is contained in:
@@ -40,6 +40,8 @@ expected =~? actual = actual ?~= expected
|
||||
infix 4 =~?
|
||||
infix 4 ?~=
|
||||
|
||||
approximateListEq expected actual = expectation expected actual (length expected == length actual && and (zipWith (\e a -> abs (e-a) < 0.01) expected actual))
|
||||
|
||||
hasElements expected actual = counterexample' (" Expected elements (in any order): " ++ show expected
|
||||
++ "\n Was: " ++ show actual)
|
||||
(sort expected == sort actual)
|
||||
|
||||
Reference in New Issue
Block a user