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

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class AUX_INHERIT_STRING1
  5.  
  6. inherit
  7.    STRING
  8.       rename make as string_make
  9.       end;
  10.  
  11. creation make
  12.    
  13. feature 
  14.    
  15.    make(init: STRING) is
  16.       local
  17.      i: INTEGER;
  18.       do
  19.      string_make(init.count);
  20.      is_true(capacity = init.count);
  21.      is_true(count = 0);
  22.  
  23.      from
  24.         i := 1;
  25.      until
  26.         i > init.count
  27.      loop
  28.         extend(init.item(i));
  29.         i := i + 1;
  30.      end;
  31.  
  32.      is_true(not empty);
  33.      is_true(count = 3);
  34.  
  35.      is_true(init.count = count);
  36.  
  37.      from
  38.         i := count;
  39.      until
  40.         i = 0
  41.      loop
  42.         is_true(init.item(i) = item(i));
  43.         i := i - 1;
  44.      end;
  45.  
  46.       end;
  47.    
  48.    is_true(b: BOOLEAN) is
  49.       do
  50.      cpt := cpt + 1;
  51.      if not b then
  52.         std_output.put_string("TEST_INHERIT_STRING1: ERROR Test # ");
  53.         std_output.put_integer(cpt);
  54.         std_output.put_string("%N");
  55.      else
  56.         -- std_output.put_string("Yes%N");
  57.      end;
  58.       end;
  59.    
  60.    cpt: INTEGER;
  61.    
  62. end -- AUX_INHERIT_STRING1
  63.