4 import unsafe::reinterpret_cast;
18 assert (!(true < false));
19 assert (!(true <= false));
20 assert (true > false);
21 assert (true >= false);
23 assert (false < true);
24 assert (false <= true);
25 assert (!(false > true));
26 assert (!(false >= true));
28 // Bools support bitwise binops
29 assert (false & false == false);
30 assert (true & false == false);
31 assert (true & true == true);
32 assert (false | false == false);
33 assert (true | false == true);
34 assert (true | true == true);
35 assert (false ^ false == false);
36 assert (true ^ false == true);
37 assert (true ^ true == false);
41 let ch10 = 10 as char;
44 assert (ch10 + ch4 == 14 as char);
45 assert (ch10 - ch4 == 6 as char);
46 assert (ch10 * ch4 == 40 as char);
47 assert (ch10 / ch4 == ch2);
48 assert (ch10 % ch4 == ch2);
49 assert (ch10 >> ch2 == ch2);
50 assert (ch10 >>> ch2 == ch2);
51 assert (ch10 << ch4 == 160 as char);
52 assert (ch10 | ch4 == 14 as char);
53 assert (ch10 & ch2 == ch2);
54 assert (ch10 ^ ch2 == 8 as char);
59 assert (@{a: 1, b: 3} < @{a: 1, b: 4});
60 assert (@{a: 'x'} != @{a: 'y'});
64 // FIXME: Re-enable this once we can compare resources.
66 let p1 = comm::port::<int>();
67 let p2 = comm::port::<int>();
75 let p: comm::port<int> = comm::port();
76 let ch1 = comm::chan(p);
77 let ch2 = comm::chan(p);
80 // Chans are equal because they are just task:port addresses.
85 // FIXME: Don't know what binops apply to pointers. Don't know how
86 // to make or use pointers
92 let t1 = task::spawn((), f1);
93 let t2 = task::spawn((), f2);
113 assert (!(f1 != f2));
127 // FIXME (#1058): comparison of native fns
128 fn test_native_fn() {
130 assert (native_mod::do_gc == native_mod::do_gc);
131 assert (native_mod::do_gc != native_mod::unsupervise);
141 // FIXME (#815): This doesn't work on linux only. Wierd.
143 //assert (!(o1 == o2));
145 obj constr1(i: int) { }
146 obj constr2(i: int) { }
148 let o5 = constr1(10);
149 let o6 = constr1(10);
150 let o7 = constr1(11);
151 let o8 = constr2(11);