Update Changes.
[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';
93430cb4 7 unshift @INC, '../lib';
9d116dd7 8}
9
10use Config;
11
36477c24 12print "1..7\n";
8d063cd8 13
14# check "" interpretation
15
16$x = "\n";
9d116dd7 17# 10 is ASCII/Iso Latin, 21 is EBCDIC.
18if ($x eq chr(10) ||
19 ($Config{ebcdic} eq 'define' && $x eq chr(21))) {print "ok 1\n";}
20else {print "not ok 1\n";}
8d063cd8 21
22# check `` processing
23
24$x = `echo hi there`;
25if ($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;
32print "#3\t:$tmp: == :1:\n";
33if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";}
34
35# check numeric literal
36
37$x = 1;
38if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";}
39
36477c24 40$x = '1E2';
41if (($x | 1) == 101) {print "ok 5\n";} else {print "not ok 5\n";}
42
8d063cd8 43# check <> pseudoliteral
44
a0d0e21e 45open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null.");
afd9f252 46if (<try> eq '') {
36477c24 47 print "ok 6\n";
afd9f252 48}
49else {
36477c24 50 print "not ok 6\n";
afd9f252 51 die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null';
52}
8d063cd8 53
a0d0e21e 54open(try, "../Configure") || (die "Can't open ../Configure.");
36477c24 55if (<try> ne '') {print "ok 7\n";} else {print "not ok 7\n";}