X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbase%2Fterm.t;h=2d3fe5a5e1e8f7b7b3e76cacc1911e8ae160c264;hb=6cc60dfb2a8776ed38cabadaa23ec442bec7ba81;hp=c3222427105970020f711ef77d61766c95752c9d;hpb=fe14fcc35f78a371a174a1d14256c2f35ae4262b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/base/term.t b/t/base/term.t old mode 100644 new mode 100755 index c322242..2d3fe5a --- a/t/base/term.t +++ b/t/base/term.t @@ -1,17 +1,25 @@ #!./perl -# $Header: term.t,v 4.0 91/03/20 01:49:17 lwall Locked $ +# $RCSfile: term.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:07 $ -print "1..6\n"; +BEGIN { + chdir 't' if -d 't'; +} + +print "1..7\n"; # check "" interpretation $x = "\n"; -if ($x lt ' ') {print "ok 1\n";} else {print "not ok 1\n";} +# 10 is ASCII/Iso Latin, 13 is Mac OS, 21 is EBCDIC. +if ($x eq chr(10)) { print "ok 1\n";} +elsif ($x eq chr(13)) { print "ok 1 # Mac OS\n"; } +elsif ($x eq chr(21)) { print "ok 1 # EBCDIC\n"; } +else {print "not ok 1\n";} # check `` processing -$x = `echo hi there`; +$x = `$^X -le "print 'hi there'"`; if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";} # check $#array @@ -27,16 +35,24 @@ if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";} $x = 1; if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";} +$x = '1E2'; +if (($x | 1) == 101) {print "ok 5\n";} else {print "not ok 5\n";} + # check <> pseudoliteral -open(try, "/dev/null") || (die "Can't open /dev/null."); +if ($^O eq 'MacOS') { + open(try,"Dev:Null") || (die "Can't open /dev/null."); +} else { + open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null."); +} + if ( eq '') { - print "ok 5\n"; + print "ok 6\n"; } else { - print "not ok 5\n"; + print "not ok 6\n"; die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null'; } -open(try, "../Makefile") || (die "Can't open ../Makefile."); -if ( ne '') {print "ok 6\n";} else {print "not ok 6\n";} +open(try, "harness") || (die "Can't open harness."); +if ( ne '') {print "ok 7\n";} else {print "not ok 7\n";}