home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / ntcode / ntperlb / t / lib / assert.nt < prev    next >
Encoding:
Text File  |  1995-05-19  |  674 b   |  27 lines

  1. print "1..2\n";
  2. require 'assert.pl';
  3.  
  4. #
  5. # NT test of assert.pl
  6. #
  7. # N.B. the quotes are strategically placed to avoid problems 
  8. #      with cmd.exe. It doesn't grok single quotes, so the outer
  9. #      quotes must be double-quotes to avoid < or > being interpreted
  10. #      as I/O redirection. Grrrr...
  11. #
  12.  
  13.  
  14. #
  15. # check that we get the ASSERTION BOTCHED message
  16. #
  17.  
  18. $x = `perl -e "require 'assert.pl'; &assert('1 < 0');" 2>&1`;
  19. if ($x =~ /BOTCHED/) {print "ok 1\n";} else {print "not ok 1\n";}
  20.  
  21. #
  22. # check that this issues no message
  23. #
  24.  
  25. $x = `perl -e "require 'assert.pl'; &assert('1 > 0');" 2>&1`;
  26. if ($x eq '') {print "ok 2\n";} else {print "not ok 2\n";}
  27.