home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_array5.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  871 b   |  46 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_ARRAY5
  5.  
  6. creation make
  7.    
  8. feature 
  9.         
  10.    make is
  11.       local
  12.      a: ARRAY[INTEGER];
  13.       do
  14.      a := <<1,2,3,4>>;
  15.      a.remove_first;
  16.      is_true(a.lower = 2);
  17.      is_true(a.first = 2);
  18.      is_true(a.last = 4);
  19.      a.remove_first;
  20.      is_true(a.lower = 3);
  21.      is_true(a.first = 3);
  22.      is_true(a.last = 4);
  23.      a.remove_first;
  24.      is_true(a.lower = 4);
  25.      is_true(a.first = 4);
  26.      is_true(a.last = 4);
  27.      a.remove_first;
  28.      is_true(a.empty);
  29.       end;
  30.    
  31.    is_true(b: BOOLEAN) is
  32.       do
  33.      cpt := cpt + 1;
  34.      if not b then
  35.         std_output.put_string("TEST_ARRAY: ERROR Test # ");
  36.         std_output.put_integer(cpt);
  37.         std_output.put_string("%N");
  38.      else
  39.         -- std_output.put_string("Yes%N");
  40.      end;
  41.       end;
  42.    
  43.    cpt: INTEGER;
  44.    
  45. end -- TEST_ARRAY5
  46.