@@ -736,7 +736,6 @@ def make_binary_cond(
736
736
Wraps a unary condition as a binary condition, e.g.
737
737
738
738
>>> unary_cond = lambda i: i == 42
739
-
740
739
>>> binary_cond_first = make_binary_cond(BinaryCondArg.FIRST, unary_cond)
741
740
>>> binary_cond_first(42, 0)
742
741
True
@@ -790,6 +789,24 @@ def partial_cond(i1: float, i2: float) -> bool:
790
789
def make_eq_input_check_result (
791
790
eq_to : BinaryCondArg , * , eq_neg : bool = False
792
791
) -> BinaryResultCheck :
792
+ """
793
+ Returns a result checker for cases where the result equals an array element
794
+
795
+ >>> check_result_first = make_eq_input_check_result(BinaryCondArg.FIRST)
796
+ >>> check_result(42, 0, 42)
797
+ True
798
+ >>> check_result_second = make_eq_input_check_result(BinaryCondArg.SECOND)
799
+ >>> check_result(42, 0, 42)
800
+ False
801
+ >>> check_result(0, 42, 42)
802
+ True
803
+ >>> check_result_neg_first = make_eq_input_check_result(BinaryCondArg.FIRST, eq_neg=True)
804
+ >>> check_result_neg_first(42, 0, 42)
805
+ False
806
+ >>> check_result_neg_first(42, 0, -42)
807
+ True
808
+
809
+ """
793
810
if eq_neg :
794
811
input_wrapper = lambda i : - i
795
812
else :
0 commit comments