home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / t / base / term.t < prev   
Text File  |  1999-07-20  |  1KB  |  56 lines

  1. #!./perl
  2.  
  3. # $RCSfile: term.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:07 $
  4.  
  5. BEGIN {
  6.     chdir 't' if -d 't';
  7.     unshift @INC, '../lib';
  8. }
  9.  
  10. use Config;
  11.  
  12. print "1..7\n";
  13.  
  14. # check "" interpretation
  15.  
  16. $x = "\n";
  17. # 10 is ASCII/Iso Latin, 21 is EBCDIC.
  18. if ($x eq chr(10) ||
  19.     ($Config{ebcdic} eq 'define' && $x eq chr(21))) {print "ok 1\n";}
  20. else {print "not ok 1\n";}
  21.  
  22. # check `` processing
  23.  
  24. $x = `echo hi there`;
  25. if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
  26.  
  27. # check $#array
  28.  
  29. $x[0] = 'foo';
  30. $x[1] = 'foo';
  31. $tmp = $#x;
  32. print "#3\t:$tmp: == :1:\n";
  33. if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";}
  34.  
  35. # check numeric literal
  36.  
  37. $x = 1;
  38. if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";}
  39.  
  40. $x = '1E2';
  41. if (($x | 1) == 101) {print "ok 5\n";} else {print "not ok 5\n";}
  42.  
  43. # check <> pseudoliteral
  44.  
  45. open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null.");
  46. if (<try> eq '') {
  47.     print "ok 6\n";
  48. }
  49. else {
  50.     print "not ok 6\n";
  51.     die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null';
  52. }
  53.  
  54. open(try, "../Configure") || (die "Can't open ../Configure.");
  55. if (<try> ne '') {print "ok 7\n";} else {print "not ok 7\n";}
  56.