Commit 42a69bee authored by Steffen Michels's avatar Steffen Michels

add inequality properties reporting its arguments on failure

parent 25d29618
Pipeline #11952 passed with stage
in 34 seconds
......@@ -28,7 +28,11 @@ instance \/ Property Bool
instance \/ Bool Property
instance \/ Property Property
(=.=) infix 4 :: !a !a -> Property | Eq, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x =.= y yields False
(=.=) infix 4 :: !a !a -> Property | Eq, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x == y yields False
(<.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x < y yields False
(<=.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x <= y yields False
(>.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x > y yields False
(>=.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a // shows values x and y if x >= y yields False
check :: !(a b -> Bool) !a !b -> Property | genShow{|*|}, JSONEncode{|*|} a & genShow{|*|}, JSONEncode{|*|} b
class (==>) infixr 1 b :: !b p -> Property | Testable p
......
......@@ -166,6 +166,18 @@ where
(=.=) infix 4 :: !a !a -> Property | Eq, genShow{|*|}, JSONEncode{|*|} a
(=.=) x y = Prop "=.=" (affirm (==) Eq x y)
(<.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a
(<.) x y = Prop "<." (affirm (<) Lt x y)
(<=.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a
(<=.) x y = Prop "<=." (affirm (<=) Le x y)
(>.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a
(>.) x y = Prop ">." (affirm (>) Gt x y)
(>=.) infix 4 :: !a !a -> Property | Ord, genShow{|*|}, JSONEncode{|*|} a
(>=.) x y = Prop ">=." (affirm (>=) Ge x y)
affirm :: !(a b->Bool) !Relation a b .GenState !.Admin -> [Admin] | genShow{|*|}, JSONEncode{|*|} a & genShow{|*|}, JSONEncode{|*|} b
affirm op rel x y rs admin
| op x y = evaluate True rs admin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment