home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_INFIX_EQUAL
-
- creation {ANY}
- make
-
- feature {ANY}
-
- make is
- local
- c: CHARACTER;
- a: ANY;
- d: DOUBLE;
- d_ref: DOUBLE_REF;
- r_ref: REAL_REF;
- animal: ANIMAL;
- dog: DOG;
- do
- -- ** c := 'a';
- -- ** is_true('a' = c);
- -- ** a := c;
- -- ** is_true(equal(a,'a'));
- -- ** is_true(not(a = 'a'));
- -- ** is_true(not('a' = a));
- -- **
- -- ** is_true(88 = 88);
- -- ** a := 88;
- -- ** is_true(equal(a,88));
- -- ** is_true(not(a = 88));
- -- ** is_true(not(88 = a));
- -- **
- -- ** is_true(88. = 88.0);
- -- ** a := 88;
- -- ** is_true(equal(a,88));
- -- ** is_true(not(a = 88));
- -- ** is_true(not(88 = a));
- -- **
- -- ** r_ref := 88.;
- -- ** is_true(r_ref.item = 88.0);
- -- ** a := 88.;
- -- ** is_true(equal(a,r_ref));
- -- ** is_true(r_ref.item = 88);
- -- ** is_true(88 = r_ref.item);
- -- **
- -- **
- -- ** d := 88.0;
- -- ** is_true(d = 88.0);
- -- ** is_true(88.0 = d);
- -- ** d_ref := d;
- -- ** is_true(d_ref.item = 88.0);
- -- ** is_true(88.0 = d_ref.item);
- -- ** a := d_ref;
- -- ** is_true(equal(a,d_ref));
- -- ** is_true(equal(a,clone(d_ref)));
- -- ** is_true(equal(clone(a),d_ref));
- -- is_true(not(d_ref = 88));
- -- is_true(not(88 = d_ref));
- -- **
- is_true(animal = dog);
- is_true(dog = animal);
- end;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_INFIX_EQUAL: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- -- std_output.put_string("Yes%N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_INFIX_EQUAL
-