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

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TESTARGS
  5. --
  6. -- Test Access to command-line arguments :
  7. --
  8.    
  9. creation make
  10.    
  11. feature 
  12.    
  13.    make is
  14.       do
  15.      if argument_count = 0 then
  16.         if not ("testargs").is_equal(argument(0)) then
  17.            std_output.put_string("TESTARGS error #1%N");
  18.         end;
  19.      elseif argument_count = 1 then
  20.         if not ("testargs").is_equal(argument(0)) then
  21.            std_output.put_string("TESTARGS error #2.0%N");
  22.         end;
  23.         if not ("1").is_equal(argument(1)) then
  24.            std_output.put_string("TESTARGS error #2.1%N");
  25.         end;
  26.      elseif argument_count = 2 then
  27.         if not ("testargs").is_equal(argument(0)) then
  28.            std_output.put_string("TESTARGS error #3.1%N");
  29.         end;
  30.         if not ("2").is_equal(argument(1)) then
  31.            std_output.put_string("TESTARGS error #3.1%N");
  32.         end;
  33.         if not ("arg2").is_equal(argument(2)) then
  34.            std_output.put_string("TESTARGS error #3.2%N");
  35.         end;
  36.      else
  37.         std_output.put_string("TESTARGS error #4%N");
  38.      end;
  39.      if argument_count /= command_arguments.upper then
  40.         std_output.put_string("TESTARGS error #5%N");
  41.      end;
  42.       end;
  43.    
  44. end -- TESTARGS
  45.