source: trunk/essentials/dev-lang/perl/lib/English.t@ 3314

Last change on this file since 3314 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 3.8 KB
Line 
1#!./perl -i.inplace
2# note the extra switch, for the test below
3
4BEGIN {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7}
8
9use Test::More tests => 55;
10
11use English qw( -no_match_vars ) ;
12use Config;
13use Errno;
14
15is( $PID, $$, '$PID' );
16
17$_ = 1;
18is( $ARG, $_, '$ARG' );
19
20sub foo {
21 is($ARG[0], $_[0], '@ARG' );
22}
23foo(1);
24
25"abc" =~ /b/;
26
27ok( !$PREMATCH, '$PREMATCH undefined' );
28ok( !$MATCH, '$MATCH undefined' );
29ok( !$POSTMATCH, '$POSTMATCH undefined' );
30
31$OFS = " ";
32$ORS = "\n";
33
34{
35 local(*IN, *OUT);
36 if ($^O ne 'dos') {
37 pipe(IN, OUT);
38 } else {
39 open(OUT, ">en.tmp");
40 }
41 select(OUT);
42 $| = 1;
43 print 'ok', '7';
44
45 # since $| is 1, this should be true
46 ok( $OUTPUT_AUTOFLUSH, '$OUTPUT_AUTOFLUSH should be true' );
47
48 my $close = close OUT;
49 ok( !($close) == $CHILD_ERROR, '$CHILD_ERROR should be false' );
50