home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_boolean2.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  1.3 KB  |  62 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_BOOLEAN2
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       do
  12.      is_true(true or else true_call);
  13.      is_true(call_count = 0);
  14.      is_true(not false or else true_call);
  15.      is_true(call_count = 0);
  16.      is_true(not(false and then true_call));
  17.      is_true(call_count = 0);
  18.      is_true(not(not true and then true_call));
  19.      is_true(call_count = 0);
  20.      
  21.      is_true(true or true_call);
  22.      debug 
  23.         -- Because mode -boost :-)
  24.         is_true(call_count = 1);
  25.         is_true(not false or true_call);
  26.         is_true(call_count = 2);
  27.         is_true(not(false and true_call));
  28.         is_true(call_count = 3);
  29.         is_true(not(not true and true_call));
  30.         is_true(call_count = 4);
  31.      end;
  32.       end;
  33.    
  34.    true_call: BOOLEAN is
  35.       do
  36.      call_count := call_count + 1;
  37.      Result := true;
  38.       end;
  39.  
  40.    false_call: BOOLEAN is
  41.       do
  42.      call_count := call_count + 1;
  43.       end;
  44.    
  45.    call_count: INTEGER;
  46.    
  47.    is_true(b: BOOLEAN) is
  48.       do
  49.      cpt := cpt + 1;
  50.      if not b then
  51.         std_output.put_string("TEST_BOOLEAN2: ERROR Test # ");
  52.         std_output.put_integer(cpt);
  53.         std_output.put_string("%N");
  54.      else
  55.         --std_output.put_string("Yes%N");
  56.      end;
  57.       end;
  58.    
  59.    cpt: INTEGER;
  60.    
  61. end -- TEST_BOOLEAN2
  62.