home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / perl / os2perl / term.t < prev    next >
Text File  |  1991-04-12  |  1KB  |  36 lines

  1. #!./perl
  2.  
  3. # $Header: term.t,v 4.0 91/03/20 01:50:36 lwall Locked $
  4.  
  5. # tests that aren't important enough for base.term
  6.  
  7. print "1..14\n";
  8.  
  9. $x = "\\n";
  10. print "#1\t:$x: eq " . ':\n:' . "\n";
  11. if ($x eq '\n') {print "ok 1\n";} else {print "not ok 1\n";}
  12.  
  13. $x = "#2\t:$x: eq :\\n:\n";
  14. print $x;
  15. unless (index($x,'\\\\')>0) {print "ok 2\n";} else {print "not ok 2\n";}
  16.  
  17. if (length('\\\\') == 2) {print "ok 3\n";} else {print "not ok 3\n";}
  18.  
  19. $one = 'a';
  20.  
  21. if (length("\\n") == 2) {print "ok 4\n";} else {print "not ok 4\n";}
  22. if (length("\\\n") == 2) {print "ok 5\n";} else {print "not ok 5\n";}
  23. if (length("$one\\n") == 3) {print "ok 6\n";} else {print "not ok 6\n";}
  24. if (length("$one\\\n") == 3) {print "ok 7\n";} else {print "not ok 7\n";}
  25. if (length("\\n$one") == 3) {print "ok 8\n";} else {print "not ok 8\n";}
  26. if (length("\\\n$one") == 3) {print "ok 9\n";} else {print "not ok 9\n";}
  27. if (length("\\${one}") == 2) {print "ok 10\n";} else {print "not ok 10\n";}
  28.  
  29. if ("${one}b" eq "ab") { print "ok 11\n";} else {print "not ok 11\n";}
  30.  
  31. @foo = (1,2,3);
  32. if ("$foo[1]b" eq "2b") { print "ok 12\n";} else {print "not ok 12\n";}
  33. if ("@foo[0..1]b" eq "1 2b") { print "ok 13\n";} else {print "not ok 13\n";}
  34. $" = '::';
  35. if ("@foo[0..1]b" eq "1::2b") { print "ok 14\n";} else {print "not ok 14\n";}
  36.