home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_eval19.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  1.8 KB  |  85 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_EVAL19
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       local
  12.      cr: CHARACTER_REF;
  13.      a: ANY;
  14.      aa: ARRAY[ANY];
  15.       do
  16.      is_true('a' = 'a');
  17.      is_true('a' < 'b');
  18.      is_true('a' <= 'b');
  19.      is_true('b' <= 'b');
  20.      is_true(('a').to_upper = 'A');
  21.      is_true(('z').to_upper = 'Z');
  22.      is_true(('+').to_upper = '+');
  23.      
  24.      is_true(('A').to_lower = 'a');
  25.      is_true(('Z').to_lower = 'z');
  26.      is_true(('+').to_lower = '+');
  27.      
  28.      is_true(('0').is_digit);
  29.      is_true(('1').is_digit);
  30.      is_true(('2').is_digit);
  31.      is_true(('3').is_digit);
  32.      is_true(('4').is_digit);
  33.      is_true(('5').is_digit);
  34.      is_true(('6').is_digit);
  35.      is_true(('7').is_digit);
  36.      is_true(('8').is_digit);
  37.      is_true(('9').is_digit);
  38.      is_true(not ('x').is_digit);
  39.      
  40.      is_true(('0').value = 0);
  41.      is_true(('1').value = 1);
  42.      is_true(('2').value = 2);
  43.      is_true(('3').value = 3);
  44.      is_true(('4').value = 4);
  45.      is_true(('5').value = 5);
  46.      is_true(('6').value = 6);
  47.      is_true(('7').value = 7);
  48.      is_true(('8').value = 8);
  49.      is_true(('9').value = 9);
  50.  
  51.      is_true(('a').code = 97);
  52.      is_true(('z').code = 122);
  53.      is_true(('A').code = 65);
  54.      is_true(('Z').code = 90);
  55.      
  56.      cr := 'x';
  57.      is_true(cr.item = 'x');
  58.      a := 'x';
  59. --     is_true(equal(a,cr));
  60. --     is_true(equal(cr,'x'));
  61. --     is_true(equal(a,'x'));
  62. --     
  63. --     !!aa.make(1,1);
  64. --     aa.put('a',1);
  65. --     is_true(equal(aa.item(1),'a'));
  66. --     --  **** A FAIRE *** is_true(26 = aa.item(1));
  67.       end;
  68.    
  69.    is_true(b: BOOLEAN) is
  70.       do
  71.      cpt := cpt + 1;
  72.      if not b then
  73.         std_output.put_string("TEST_EVAL19: ERROR Test # ");
  74.         std_output.put_integer(cpt);
  75.         std_output.put_string("%N");
  76.      else
  77.         -- std_output.put_string("Yes%N");
  78.      end;
  79.       end;
  80.    
  81.    cpt: INTEGER;
  82.    
  83. end -- TEST_EVAL19
  84.  
  85.