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_string_copy.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  828 b   |  44 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_STRING_COPY
  5.    
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      s1, s2: STRING;
  14.       do
  15.      s2 := clone(str);
  16.      s1 := "CDE";
  17.      str.copy(s1);
  18.      is_true(str.count = 3);
  19.      is_true(s1 /= str);
  20.      is_true('C' = s1.item(1));
  21.      is_true('D' = s1.item(2));
  22.      is_true('E' = s1.item(3));
  23.      
  24.      is_true(equal("ABCDE",s2));
  25.       end;
  26.    
  27.    str: STRING is "ABCDE";
  28.    
  29.    is_true(b: BOOLEAN) is
  30.       do
  31.      cpt := cpt + 1;
  32.      if not b then
  33.         std_output.put_string("TEST_STRING_COPY: ERROR Test # ");
  34.         std_output.put_integer(cpt);
  35.         std_output.put_string("%N");
  36.      else
  37.         -- std_output.put_string("Yes %N");
  38.      end;
  39.       end;
  40.    
  41.    cpt: INTEGER;
  42.    
  43. end -- TEST_STRING_COPY
  44.