summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-10-27 14:06:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-10-27 14:06:44 +0000
commit44df151e4458e9bf9344461ae3bf7e4905725e11 (patch)
tree2bdf0dec28a91f5b0e5b8445ed6c203c64e7268a /t
parent47ec2758dba1fc7c51534cbb6a30565eb3790ae7 (diff)
parent5b9682978328607bb89bcea4b26ea0930848c845 (diff)
downloadperl-44df151e4458e9bf9344461ae3bf7e4905725e11.tar.gz
Integrate with Sarathy; manual resolve on regcomp.c conflicts
(Ilya's changes won). p4raw-id: //depot/cfgperl@4468
Diffstat (limited to 't')
-rwxr-xr-xt/io/fs.t10
-rwxr-xr-xt/op/int.t17
-rwxr-xr-xt/op/lex_assign.t1
-rwxr-xr-xt/op/magic.t23
-rw-r--r--t/pragma/warn/op2
5 files changed, 40 insertions, 13 deletions
diff --git a/t/io/fs.t b/t/io/fs.t
index 087021bb73..31929708a4 100755
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -147,12 +147,18 @@ else {
print FH "helloworld\n";
truncate FH, 5;
}
- if ($^O eq 'dos') {
+ if ($^O eq 'dos'
+ # Not needed on HPFS, but needed on HPFS386 ?!
+ or $^O eq 'os2')
+ {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
if (-s "Iofs.tmp" == 5) {print "ok 25\n"} else {print "not ok 25\n"}
truncate FH, 0;
- if ($^O eq 'dos') {
+ if ($^O eq 'dos'
+ # Not needed on HPFS, but needed on HPFS386 ?!
+ or $^O eq 'os2')
+ {
close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp";
}
if (-z "Iofs.tmp") {print "ok 26\n"} else {print "not ok 26\n"}
diff --git a/t/op/int.t b/t/op/int.t
index eb060acd72..6ac0866a2b 100755
--- a/t/op/int.t
+++ b/t/op/int.t
@@ -1,8 +1,11 @@
#!./perl
-# $RCSfile: int.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:00 $
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
-print "1..4\n";
+print "1..6\n";
# compile time evaluation
@@ -15,3 +18,13 @@ if (int(-1.234) == -1) {print "ok 2\n";} else {print "not ok 2\n";}
$x = 1.234;
if (int($x) == 1) {print "ok 3\n";} else {print "not ok 3\n";}
if (int(-$x) == -1) {print "ok 4\n";} else {print "not ok 4\n";}
+
+$x = length("abc") % -10;
+print $x == -7 ? "ok 5\n" : "# expected -7, got $x\nnot ok 5\n";
+
+{
+ use integer;
+ $x = length("abc") % -10;
+ $y = (3/-10)*-10;
+ print $x+$y == 3 && abs($x) < 10 ? "ok 6\n" : "not ok 6\n";
+}
diff --git a/t/op/lex_assign.t b/t/op/lex_assign.t
index b5c471a5a0..0f658694dd 100755
--- a/t/op/lex_assign.t
+++ b/t/op/lex_assign.t
@@ -4,6 +4,7 @@ BEGIN {
chdir 't' if -d 't';
unshift @INC, '../lib';
}
+$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
umask 0;
$xref = \ "";
diff --git a/t/op/magic.t b/t/op/magic.t
index 31765e2c50..fe55521814 100755
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -22,6 +22,7 @@ sub ok {
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_VMS = $^O eq 'VMS';
$Is_Dos = $^O eq 'dos';
+$Is_os2 = $^O eq 'os2';
$Is_Cygwin = $^O =~ /cygwin/;
$PERL = ($Is_MSWin32 ? '.\perl' : './perl');
@@ -117,6 +118,9 @@ ok 18, $$ > 0, $$;
chomp($wd = `pwd`);
$wd =~ s#/t$##;
}
+ elsif($Is_os2) {
+ $wd = Cwd::sys_cwd();
+ }
else {
$wd = '.';
}
@@ -142,6 +146,9 @@ __END__
:endofperl
EOT
}
+ elsif ($Is_os2) {
+ $script = "./show-shebang";
+ }
if ($^O eq 'os390' or $^O eq 'posix-bc' or $^O eq 'vmesa') { # no shebang
$headmaybe = <<EOH ;
eval 'exec ./perl -S \$0 \${1+"\$\@"}'
@@ -158,15 +165,15 @@ EOF
ok 21, close(SCRIPT), $!;
ok 22, chmod(0755, $script), $!;
$_ = `$script`;
- s/\.exe//i if $Is_Dos or $Is_Cygwin;
+ s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2;
s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
s{is perl}{is $perl}; # for systems where $^X is only a basename
s{\\}{/}g;
- ok 23, ($Is_MSWin32 ? uc($_) eq uc($s1) : $_ eq $s1), ":$_:!=:$s1:";
+ ok 23, (($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1:";
$_ = `$perl $script`;
- s/\.exe//i if $Is_Dos;
+ s/\.exe//i if $Is_Dos or $Is_os2;
s{\\}{/}g;
- ok 24, ($Is_MSWin32 ? uc($_) eq uc($s1) : $_ eq $s1), ":$_:!=:$s1: after `$perl $script`";
+ ok 24, (($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1: after `$perl $script`";
ok 25, unlink($script), $!;
}
@@ -211,8 +218,8 @@ if ($Is_MSWin32) {
ok 35, (scalar(keys(%ENV)) == 0);
}
else {
- ok "32 # skipped",1;
- ok "33 # skipped",1;
- ok "34 # skipped",1;
- ok "35 # skipped",1;
+ ok "32 # skipped: no caseless %ENV support",1;
+ ok "33 # skipped: no caseless %ENV support",1;
+ ok "34 # skipped: no caseless %ENV support",1;
+ ok "35 # skipped: no caseless %ENV support",1;
}
diff --git a/t/pragma/warn/op b/t/pragma/warn/op
index 950c0c8ffd..9a278effe9 100644
--- a/t/pragma/warn/op
+++ b/t/pragma/warn/op
@@ -558,7 +558,7 @@ Useless use of a constant in void context at - line 3.
Useless use of a constant in void context at - line 4.
########
# op.c
-$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak
+BEGIN{ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } # known scalar leak
use warnings 'unsafe' ;
my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
@a =~ /abc/ ;