| 1 | #!./perl -i.inplace
|
|---|
| 2 | # note the extra switch, for the test below
|
|---|
| 3 |
|
|---|
| 4 | BEGIN {
|
|---|
| 5 | chdir 't' if -d 't';
|
|---|
| 6 | @INC = '../lib';
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | use Test::More tests => 55;
|
|---|
| 10 |
|
|---|
| 11 | use English qw( -no_match_vars ) ;
|
|---|
| 12 | use Config;
|
|---|
| 13 | use Errno;
|
|---|
| 14 |
|
|---|
| 15 | is( $PID, $$, '$PID' );
|
|---|
| 16 |
|
|---|
| 17 | $_ = 1;
|
|---|
| 18 | is( $ARG, $_, '$ARG' );
|
|---|
| 19 |
|
|---|
| 20 | sub foo {
|
|---|
| 21 | is($ARG[0], $_[0], '@ARG' );
|
|---|
| 22 | }
|
|---|
| 23 | foo(1);
|
|---|
| 24 |
|
|---|
| 25 | "abc" =~ /b/;
|
|---|
| 26 |
|
|---|
| 27 | ok( !$PREMATCH, '$PREMATCH undefined' );
|
|---|
| 28 | ok( !$MATCH, '$MATCH undefined' );
|
|---|
| 29 | ok( !$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 |
|
|---|
|
|---|