Commit | Line | Data |
---|---|---|
8d063cd8 LW |
1 | #!./perl |
2 | ||
79072805 | 3 | # $RCSfile: term.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:07 $ |
8d063cd8 | 4 | |
36477c24 | 5 | print "1..7\n"; |
8d063cd8 LW |
6 | |
7 | # check "" interpretation | |
8 | ||
9 | $x = "\n"; | |
54361571 | 10 | if ($x eq chr(10)) {print "ok 1\n";} else {print "not ok 1\n";} |
8d063cd8 LW |
11 | |
12 | # check `` processing | |
13 | ||
14 | $x = `echo hi there`; | |
15 | if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";} | |
16 | ||
17 | # check $#array | |
18 | ||
19 | $x[0] = 'foo'; | |
20 | $x[1] = 'foo'; | |
21 | $tmp = $#x; | |
22 | print "#3\t:$tmp: == :1:\n"; | |
23 | if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";} | |
24 | ||
25 | # check numeric literal | |
26 | ||
27 | $x = 1; | |
28 | if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";} | |
29 | ||
36477c24 | 30 | $x = '1E2'; |
31 | if (($x | 1) == 101) {print "ok 5\n";} else {print "not ok 5\n";} | |
32 | ||
8d063cd8 LW |
33 | # check <> pseudoliteral |
34 | ||
a0d0e21e | 35 | open(try, "/dev/null") || open(try,"nla0:") || (die "Can't open /dev/null."); |
afd9f252 | 36 | if (<try> eq '') { |
36477c24 | 37 | print "ok 6\n"; |
afd9f252 LW |
38 | } |
39 | else { | |
36477c24 | 40 | print "not ok 6\n"; |
afd9f252 LW |
41 | die "/dev/null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c '/dev/null'; |
42 | } | |
8d063cd8 | 43 | |
a0d0e21e | 44 | open(try, "../Configure") || (die "Can't open ../Configure."); |
36477c24 | 45 | if (<try> ne '') {print "ok 7\n";} else {print "not ok 7\n";} |