home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_infix_equal.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.7 KB  |  80 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_INFIX_EQUAL
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      c: CHARACTER;
  14.      a: ANY;
  15.      d: DOUBLE;
  16.      d_ref: DOUBLE_REF;
  17.      r_ref: REAL_REF;
  18.      animal: ANIMAL;
  19.      dog: DOG;
  20.       do
  21. -- **     c := 'a';
  22. -- **     is_true('a' = c);
  23. -- **     a := c;
  24. -- **     is_true(equal(a,'a'));
  25. -- **     is_true(not(a = 'a'));
  26. -- **     is_true(not('a' = a));
  27. -- **     
  28. -- **     is_true(88 = 88);
  29. -- **     a := 88;
  30. -- **     is_true(equal(a,88));
  31. -- **     is_true(not(a = 88));
  32. -- **     is_true(not(88 = a));
  33. -- **     
  34. -- **     is_true(88. = 88.0);
  35. -- **     a := 88;
  36. -- **     is_true(equal(a,88));
  37. -- **     is_true(not(a = 88));
  38. -- **     is_true(not(88 = a));
  39. -- **     
  40. -- **     r_ref := 88.; 
  41. -- **     is_true(r_ref.item = 88.0);
  42. -- **     a := 88.;
  43. -- **     is_true(equal(a,r_ref));
  44. -- **     is_true(r_ref.item = 88);
  45. -- **     is_true(88 = r_ref.item);
  46. -- **
  47. -- **     
  48. -- **     d := 88.0;
  49. -- **     is_true(d = 88.0);
  50. -- **     is_true(88.0 = d);
  51. -- **     d_ref := d;
  52. -- **     is_true(d_ref.item = 88.0);
  53. -- **     is_true(88.0 = d_ref.item);
  54. -- **     a := d_ref;
  55. -- **     is_true(equal(a,d_ref));
  56. -- **     is_true(equal(a,clone(d_ref)));
  57. -- **     is_true(equal(clone(a),d_ref));
  58. --     is_true(not(d_ref = 88));
  59. --     is_true(not(88 = d_ref));
  60. -- **     
  61.            is_true(animal = dog);
  62.      is_true(dog = animal);
  63.       end;
  64.  
  65.    is_true(b: BOOLEAN) is
  66.       do
  67.      cpt := cpt + 1;
  68.      if not b then
  69.         std_output.put_string("TEST_INFIX_EQUAL: ERROR Test # ");
  70.         std_output.put_integer(cpt);
  71.         std_output.put_string("%N");
  72.      else
  73.         -- std_output.put_string("Yes%N");
  74.      end;
  75.       end;
  76.    
  77.    cpt: INTEGER;
  78.    
  79. end -- TEST_INFIX_EQUAL
  80.