5 assert (Eq_sum.eq S0 S0
);
6 assert (not
(Eq_sum.eq S0
(S1
0)));
7 assert (Eq_sum.eq
(S1
0) (S1
0));
8 assert (Eq_sum.eq
(Stup
(3,0.0)) (Stup
(3,0.0)));
9 assert (not
(Eq_sum.eq
(Stup
(0,0.0)) (Stup
(1,0.0))));
14 assert (Eq_nullsum.eq N2 N2
)
20 { r1_l1
= 10; r1_l2
= 20 }
21 { r1_l1
= 10; r1_l2
= 20 });
23 { r1_l1
= 20; r1_l2
= 10 }
24 { r1_l1
= 10; r1_l2
= 20 }));
29 let l, r
= ({ r2_l1
= 10; r2_l2
= 20},
30 { r2_l1
= 10; r2_l2
= 20}) in
31 assert (Eq_r2.eq
l l);
32 assert (not
(Eq_r2.eq
l r
));
33 assert (not
(Eq_r2.eq r
l));
38 let l, r
= ({ r3_l1
= 10; r3_l2
= 20},
39 { r3_l1
= 10; r3_l2
= 20}) in
40 assert (Eq_r3.eq
l l);
41 assert (not
(Eq_r3.eq
l r
));
42 assert (not
(Eq_r3.eq r
l));
47 assert (Eq_intseq.eq INil INil
);
51 assert (not
(Eq_intseq.eq
54 assert (not
(Eq_intseq.eq
57 assert (not
(Eq_intseq.eq
59 (let rec i = ICons
(1,i) in i)));
64 let eq = Eq_uses_seqs.eq in
65 assert (eq (INil
,Cons
(1.0,Nil
)) (INil
,Cons
(1.0,Nil
)));
66 assert (not
(eq (INil
,Cons
(1.0,Nil
)) (INil
,Cons
(2.0,Nil
))));
67 assert (not
(eq (ICons
(1,INil
),Nil
) (INil
,Nil
)));
72 let eq = Eq_poly0.eq in
74 assert (not
(eq `T1 `T3
));
79 let eq = Eq_poly1.eq in
81 assert (eq (`T1
10) (`T1
10));
82 assert (not
(eq (`T1
20) (`T1
10)));
83 assert (not
(eq (`T1
20) `T0
));
88 let eq = Eq_poly2.eq in
89 assert (eq (P
(3, `T0
, 0.0)) (P
(3, `T0
, 0.0)));
90 assert (eq (P
(4, `T1
10, 2.0)) (P
(4, `T1
10, 2.0)));
91 assert (not
(eq (P
(5, `T1
10, 2.0)) (P
(5, `T0
, 2.0))));
92 assert (not
(eq (P
(6, `T0
, 2.0)) (P
(6, `T0
, 10.0))));
93 assert (not
(eq (P
(0, `T0
, 2.0)) (P
(7, `T0
, 2.0))));
99 let eq = Eq_poly3.eq in
100 assert (eq `Nil `Nil
);
101 assert (eq (`Cons
(3,`Nil
)) (`Cons
(3,`Nil
)));
102 assert (eq (`Cons
(3,`Cons
(4,`Nil
))) (`Cons
(3,`Cons
(4,`Nil
))));
103 assert (not
(eq (`Cons
(3,`Cons
(4,`Nil
))) (`Cons
(3,`Nil
))));
108 let eq = Eq_poly3b.eq in
109 assert (eq (0,`Nil
,`F
) (0,`Nil
,`F
));
110 assert (not
(eq (0,`Cons
(1,`Nil
),`F
) (0,`Nil
,`F
)));
111 assert (not
(eq (1,`Nil
,`F
) (0,`Nil
,`F
)));
117 let module M7
= Eq_poly7
(Eq.Eq_int
) in
118 let module M8
= Eq_poly8
(Eq.Eq_int
) in
119 assert (M7.eq (Foo
(`F
0)) (Foo
(`F
0)));
120 assert (not
(M7.eq (Foo
(`F
0)) (Foo
(`F
1))));
122 {x
= `G
(`H
(`I
(Foo
(`F
0))))}
123 {x
= `G
(`H
(`I
(Foo
(`F
0))))});
126 {x
= `G
(`H
(`I
(Foo
(`F
0))))}
127 {x
= `G
(`H
(`I
(Foo
(`F
1))))}));
132 let eq = Eq_poly10.eq in
134 assert (eq `Nil `Nil
);
135 assert (not
(eq `Nil `F
));
140 let rec cyclic_1 = S
(0, cyclic_2
)
141 and cyclic_2
= S
(1, cyclic_1) in
142 assert (not
(Eq_mutrec_a.eq cyclic_1 cyclic_2
));
145 (`T
{l1
= cyclic_1; l2
= cyclic_2
})
146 (`T
{l1
= cyclic_2
; l2
= cyclic_1})));
151 let module M_a
= Eq_pmutrec_a
(Eq.Eq_int
)(Eq.Eq_bool
) in
152 let module M_b
= Eq_pmutrec_b
(Eq.Eq_int
)(Eq.Eq_bool
) in
153 let module M_c
= Eq_pmutrec_c
(Eq.Eq_int
)(Eq.Eq_bool
) in
154 let module M_d
= Eq_pmutrec_d
(Eq.Eq_int
)(Eq.Eq_bool
) in
156 let rec cyclic_1 = SS
(0, cyclic_2
, true)
157 and cyclic_2
= SS
(1, cyclic_1, true) in
158 assert (not
(M_a.eq cyclic_1 cyclic_2
));
161 (`T
{pl1
= cyclic_1; pl2
= cyclic_2
})
162 (`T
{pl1
= cyclic_2
; pl2
= cyclic_1})));
168 let module M
= Eq_ff1
(Eq.Eq_bool
) in
169 assert (M.eq (F
(true,false)) (F
(true,false)));
170 assert (M.eq (G
(-1)) (G
(-1)));
171 assert (not
(M.eq (F
(false,true)) (F
(true,false))));
172 assert (not
(M.eq (G
(-1)) (G
0)));
173 assert (not
(M.eq (G
(-1)) (F
(true, true))));
178 let module M
= Eq_ff2
(Eq.Eq_bool
)(Eq.Eq_bool
) in
180 (F1
(F2
(Cons
(true,Nil
), 0, None
)))
181 (F1
(F2
(Cons
(true,Nil
), 0, None
))));
185 (F2
(Cons
(true,Nil
), 0, None
))));
188 (F2
(Cons
(true,Nil
), 0, Some
true))
189 (F2
(Cons
(true,Nil
), 0, Some
false))));
192 (F2
(Cons
(true,Nil
), 0, None
))
193 (F2
(Cons
(true,Nil
), 0, Some
false))));
198 assert (Eq_tup0.eq () ());
203 assert (Eq_tup2.eq (10,5.0) (10,5.0));
204 assert (not
(Eq_tup2.eq (10,5.0) (11,5.0)));
205 assert (not
(Eq_tup2.eq (10,5.0) (10,4.0)));
210 assert (Eq_tup3.eq (10,2.5,true) (10,2.5,true));
211 assert (not
(Eq_tup3.eq (10,2.5,true) (11,2.5,true)));
212 assert (not
(Eq_tup3.eq (10,2.5,true) (10,2.4,true)));
213 assert (not
(Eq_tup3.eq (10,2.5,true) (10,2.5,false)));
218 assert (Eq_tup4.eq (1,2,true,()) (1,2,true,()));
219 assert (not
(Eq_tup4.eq (1,2,true,()) (0,2,true,())));
220 assert (not
(Eq_tup4.eq (1,2,true,()) (1,3,true,())));
221 assert (not
(Eq_tup4.eq (1,2,true,()) (1,2,false,())));
227 assert (Eq_withref.eq (WR
(0,x)) (WR
(0,x)));
228 assert (not
(Eq_withref.eq (WR
(0,x)) (WR
(0,ref 0))));
233 assert (Eq_t.eq 0 0);
234 assert (Eq_t.eq (-10) (-10));
235 assert (Eq_t.eq 14 14);
236 assert (not
(Eq_t.eq 14 0));
237 assert (not
(Eq_t.eq 0 14));
238 assert (not
(Eq_t.eq (-1) 0));