Forgotten fragment.
[p5sagit/p5-mst-13.2.git] / t / base / term.t
CommitLineData
8d063cd8 1#!./perl
2
79072805 3# $RCSfile: term.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:07 $
8d063cd8 4
9d116dd7 5BEGIN {
6 chdir 't' if -d 't';
9d116dd7 7}
8
36477c24 9print "1..7\n";
8d063cd8 10
11# check "" interpretation
12
13$x = "\n";
9d116dd7 14# 10 is ASCII/Iso Latin, 21 is EBCDIC.
b25e12d2 15if ($x eq chr(10)) { print "ok 1\n";}
16elsif ($x eq chr(21)) { print "ok 1 # EBCDIC\n"; }
9d116dd7 17else {print "not ok 1\n";}
8d063cd8 18
19# check `` processing
20
21$x = `echo hi there`;
22if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
23
24# check $#array
25
26$x[0] = 'foo';
27$x[1] = 'foo';
28$tmp = $#x;
29print "#3\t:$tmp: == :1:\n";
30if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";}
31
32# check numeric literal
33
34$x = 1;
35if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";}
36
36477c24 37$x = '1E2';
38if (($x | 1) == 101) {print "ok 5\n";} else {print "not ok 5\n";}
39
8d063cd8 40# check <> pseudoliteral
41
a0d0e21e 42open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null.");
afd9f252 43if (<try> eq '') {
36477c24 44 print "ok 6\n";
afd9f252 45}
46else {
36477c24 47 print "not ok 6\n";
afd9f252 48 die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null';
49}
8d063cd8 50
2eb25c99 51open(try, "harness") || (die "Can't open harness.");
36477c24 52if (<try> ne '') {print "ok 7\n";} else {print "not ok 7\n";}