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_arguments.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.2 KB  |  43 lines

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