From 9d116dd7c895b17badf4ad422ae44da0c4df7bc2 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 1 Aug 1998 15:03:02 +0300 Subject: support OE/MVS Message-Id: <199808010903.MAA09371@alpha.hut.fi> Subject: [PATCH] 5.005_01: OE MVS p4raw-id: //depot/maint-5.005/perl@1697 --- t/op/misc.t | 1 + 1 file changed, 1 insertion(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 449d87cea1..7292ffebd4 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -36,6 +36,7 @@ for (@prgs){ $status = $?; $results = `$CAT $tmpfile`; $results =~ s/\n+$//; + $results =~ s/syntax error/syntax error/i; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From ebf99b04cc4af488057bd9d08bb6a2768960923c Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Wed, 14 Oct 1998 05:37:10 +0000 Subject: let docatch() pass the buck when restartop turns out to be null, making exceptions in BEGIN{} propagate as expected p4raw-id: //depot/perl@1947 --- t/op/misc.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 7292ffebd4..667db989bf 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -418,3 +418,15 @@ EXPECT destroyed destroyed ######## +BEGIN { + $| = 1; + $SIG{__WARN__} = sub { + eval { print $_[0] }; + die "bar\n"; + }; + warn "foo\n"; +} +EXPECT +foo +bar +BEGIN failed--compilation aborted at - line 8. -- cgit v1.2.1 From d91e2bdb4bc210a23427760819d26aa7951da955 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 17 Oct 1998 14:59:15 +0000 Subject: More robust yacc/bison failure output handling. p4raw-id: //depot/cfgperl@2011 --- t/op/misc.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 667db989bf..b924f89847 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -36,7 +36,9 @@ for (@prgs){ $status = $?; $results = `$CAT $tmpfile`; $results =~ s/\n+$//; - $results =~ s/syntax error/syntax error/i; +# bison says 'parser error' instead of 'syntax error', +# various yaccs may or may not capitalize 'syntax'. + $results =~ s/^(syntax|parser) error/\L$1 error/i; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From 2c88fa888f003d5ed662773b59e0a8b1ff819c61 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 26 Oct 1998 09:08:00 +0000 Subject: More robustness. p4raw-id: //depot/cfgperl@2092 --- t/op/misc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index b924f89847..f8bc215737 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -38,7 +38,7 @@ for (@prgs){ $results =~ s/\n+$//; # bison says 'parser error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parser) error/\L$1 error/i; + $results =~ s/^(syntax|parser) error/\L$1 error/mi; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From f0ec1f9abfb9cd61b0c90f06c7dc6e2bb4182791 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Wed, 28 Oct 1998 08:44:49 +0000 Subject: Bison says 'parse error', not 'parser error'. p4raw-id: //depot/cfgperl@2106 --- t/op/misc.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index f8bc215737..6815f82911 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -36,9 +36,9 @@ for (@prgs){ $status = $?; $results = `$CAT $tmpfile`; $results =~ s/\n+$//; -# bison says 'parser error' instead of 'syntax error', +# bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parser) error/\L$1 error/mi; + $results =~ s/^(syntax|parse) error/\L$1 error/mi; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From 1c5a9b9c42bc8485ae6ca52cd66d75dd8e8d746f Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Wed, 28 Oct 1998 10:33:36 +0000 Subject: The "parse error" must be converted to "syntax error", just matching it aint' enough. p4raw-id: //depot/cfgperl@2108 --- t/op/misc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 6815f82911..a8ba4c89ef 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -38,7 +38,7 @@ for (@prgs){ $results =~ s/\n+$//; # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parse) error/\L$1 error/mi; + $results =~ s/^(syntax|parse) error/syntax error/mi; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From 2a8ee23279873759693fa83eca279355db2b665c Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 30 Oct 1998 13:27:39 +0000 Subject: There can be multiple yacc/bison errors. p4raw-id: //depot/cfgperl@2143 --- t/op/misc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index a8ba4c89ef..f57531c9bd 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -38,7 +38,7 @@ for (@prgs){ $results =~ s/\n+$//; # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parse) error/syntax error/mi; + $results =~ s/^(syntax|parse) error/syntax error/mig; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; -- cgit v1.2.1 From 8feb4e9f33850f8c93443f87f3039b93e7d666e1 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 2 Jan 1999 14:55:06 +0000 Subject: Object destruction order testing. p4raw-id: //depot/cfgperl@2554 --- t/op/misc.t | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index f57531c9bd..9fe98c4589 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -40,7 +40,7 @@ for (@prgs){ # various yaccs may or may not capitalize 'syntax'. $results =~ s/^(syntax|parse) error/syntax error/mig; $expected =~ s/\n+$//; - if ( $results ne $expected){ + if ( $results ne $expected ) { print STDERR "PROG: $switch\n$prog\n"; print STDERR "EXPECTED:\n$expected\n"; print STDERR "GOT:\n$results\n"; @@ -432,3 +432,44 @@ EXPECT foo bar BEGIN failed--compilation aborted at - line 8. +######## +package X; +@ISA='Y'; +sub new { + my $class = shift; + my $self = { }; + bless $self, $class; + my $init = shift; + $self->foo($init); + print "new", $init; + return $self; +} +sub DESTROY { + my $self = shift; + print "DESTROY", $self->foo; +} +package Y; +sub attribute { + my $self = shift; + my $var = shift; + if (@_ == 0) { + return $self->{$var}; + } elsif (@_ == 1) { + $self->{$var} = shift; + } +} +sub AUTOLOAD { + $AUTOLOAD =~ /::([^:]+)$/; + my $method = $1; + splice @_, 1, 0, $method; + goto &attribute; +} +package main; +my $x = X->new(1); +for (2..3) { + my $y = X->new($_); + print $y->foo; +} +print $x->foo; +EXPECT +new1new22DESTROY2new33DESTROY31DESTROY1 -- cgit v1.2.1 From 35cd451c5a1303394968903750cc3b3a1a6bc892 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 12 Feb 1999 05:39:29 +0000 Subject: fix ops that are not filehandle constructors to not create GV if it doesn't already exist (avoids leaks); extend semantics of defined() so that defined(*{$foo}) works (experimental) p4raw-id: //depot/perl@2879 --- t/op/misc.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 9fe98c4589..57d57b7b37 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -411,7 +411,13 @@ destroyed package X; sub any { bless {} } my $f = "FH000"; # just to thwart any future optimisations -sub afh { select select ++$f; my $r = *{$f}{IO}; delete $X::{$f}; bless $r } +sub afh { + open(++$f, '>&STDOUT') or die; + select select $f; + my $r = *{$f}{IO}; + delete $X::{$f}; + bless $r; +} sub DESTROY { print "destroyed\n" } package main; $x = any X; # to bump sv_objcount. IO objs aren't counted?? -- cgit v1.2.1 From 93430cb427caeba01ba89b008008b46159a7c165 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 12 Feb 1999 10:31:17 +0000 Subject: make testsuite somewhat location independent p4raw-id: //depot/perl@2891 --- t/op/misc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 57d57b7b37..78c8bf2eec 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -4,7 +4,7 @@ # separate executable and can't simply use eval. chdir 't' if -d 't'; -@INC = "../lib"; +unshift @INC, "../lib"; $ENV{PERL5LIB} = "../lib"; $|=1; -- cgit v1.2.1 From 648cac195c82cb1f1b31f3751c1a36107e153a68 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Tue, 19 Jan 1999 15:13:15 -0500 Subject: Remove extraneous sh in test suites Message-ID: <19990119201315.A21167@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2893 --- t/op/misc.t | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 78c8bf2eec..778476e124 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -25,17 +25,20 @@ for (@prgs){ $switch = $1; } my($prog,$expected) = split(/\nEXPECT\n/, $_); + open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!"; + print TEST $prog, "\n"; + close TEST or die "Cannot close $tmpfile: $!"; + if ($^O eq 'MSWin32') { - open TEST, "| .\\perl -I../lib $switch >$tmpfile 2>&1"; + $results = `.\\perl -I../lib $switch $tmpfile 2>&1`; } else { - open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1"; + $results = `./perl $switch $tmpfile 2>&1`; } - print TEST $prog, "\n"; - close TEST; $status = $?; - $results = `$CAT $tmpfile`; $results =~ s/\n+$//; + $results =~ s/at\s+misctmp\d+\s+line/at - line/g; + $results =~ s/of\s+misctmp\d+\s+aborted/of - aborted/g; # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. $results =~ s/^(syntax|parse) error/syntax error/mig; @@ -77,7 +80,7 @@ $x=0x0eabcd; print $x->ref; EXPECT Can't call method "ref" without a package or object reference at - line 1. ######## -chop ($str .= ); +chop ($str .= ); ######## close ($banana); ######## @@ -89,7 +92,7 @@ eval {sub bar {print "In bar";}} ######## system './perl -ne "print if eof" /dev/null' ######## -chop($file = <>); +chop($file = ); ######## package N; sub new {my ($obj,$n)=@_; bless \$n} -- cgit v1.2.1 From ded8aa31a400d00437fd50627d6c8013f58fd6ab Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 14 Feb 1999 10:25:55 +0000 Subject: allow C to autovivify *foo (SelectSaver expects that) p4raw-id: //depot/perl@2914 --- t/op/misc.t | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 778476e124..acef29de9a 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -414,13 +414,7 @@ destroyed package X; sub any { bless {} } my $f = "FH000"; # just to thwart any future optimisations -sub afh { - open(++$f, '>&STDOUT') or die; - select select $f; - my $r = *{$f}{IO}; - delete $X::{$f}; - bless $r; -} +sub afh { select select ++$f; my $r = *{$f}{IO}; delete $X::{$f}; bless $r } sub DESTROY { print "destroyed\n" } package main; $x = any X; # to bump sv_objcount. IO objs aren't counted?? -- cgit v1.2.1 From dfad63adc8924929eac70ad8db0652253a4efff0 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Wed, 17 Feb 1999 10:06:01 +0000 Subject: fix comppad handling for failures in eval 'qr/(?p{...})/' Message-Id: <199902171006.KAA10204@crypt.compulink.co.uk> Subject: Re: [5.005_53] panic: pad_free curpad p4raw-id: //depot/perl@2963 --- t/op/misc.t | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index acef29de9a..2d19ee1b4b 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -476,3 +476,10 @@ for (2..3) { print $x->foo; EXPECT new1new22DESTROY2new33DESTROY31DESTROY1 +######## +re(); +sub re { + my $re = join '', eval 'qr/(?p{ $obj->method })/'; + $re; +} +EXPECT -- cgit v1.2.1 From 1aff0e911b5282f0638dc0d8199ffa4edf98f89c Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 18 Feb 1999 21:41:57 +0000 Subject: distinguish eval'' from BEGIN|INIT|END CVs (fixes buggy propagation of lexical searches in BEGIN|INIT|END) p4raw-id: //depot/perl@2975 --- t/op/misc.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 2d19ee1b4b..48e22f6405 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -483,3 +483,17 @@ sub re { $re; } EXPECT +######## +use strict; +my $foo = "ZZZ\n"; +END { print $foo } +EXPECT +ZZZ +######## +eval ' +use strict; +my $foo = "ZZZ\n"; +END { print $foo } +'; +EXPECT +ZZZ -- cgit v1.2.1 From d98d5fffa337682ca6cac752b32ff55e863a53a0 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 26 Mar 1999 01:30:25 +0000 Subject: specify type of bracket in "Unmatched bracket" diagnostic; prefer 'brace' or 'curly bracket' over 'curly brace' p4raw-id: //depot/perl@3170 --- t/op/misc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 48e22f6405..8281bf0e77 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -349,7 +349,7 @@ Sequence (?{...}) not terminated or not {}-balanced at - line 1, within pattern ######## /(?{"{"}})/ # Check it outside of eval too EXPECT -Unmatched right bracket at (re_eval 1) line 1, at end of line +Unmatched right curly bracket at (re_eval 1) line 1, at end of line syntax error at (re_eval 1) line 1, near ""{"}" Compilation failed in regexp at - line 1. ######## -- cgit v1.2.1 From 7399586d384137f7ae66bcc82a83b0df7dd429e5 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Wed, 23 Jun 1999 18:27:42 +0100 Subject: applied suggested patch for tracking line numbers correctly in optimized blocks with a single statement; changed setcop to setstate and added code for -Dx dumps Message-Id: <199906231627.RAA24033@crypt.compulink.co.uk> Subject: [PATCH 5.005_57] Line number error in optimised else() p4raw-id: //depot/perl@3728 --- t/op/misc.t | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 8281bf0e77..926c7f38d0 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -497,3 +497,11 @@ END { print $foo } '; EXPECT ZZZ +######## +-w +if (@ARGV) { print "" } +else { + if ($x == 0) { print "" } else { print $x } +} +EXPECT +Use of uninitialized value at - line 4. -- cgit v1.2.1 From ea12c2aa2714a53b7f16f1990366373be0ed8933 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 4 Sep 1999 13:12:14 +0000 Subject: Enable 64-bit clean bit ops. (Disables the t/op/misc.t substest 3 in 64-bit platforms.) p4raw-id: //depot/cfgperl@4070 --- t/op/misc.t | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 926c7f38d0..46b9a0457d 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -59,9 +59,19 @@ $a = ":="; split /($a)/o, "a:=b:=c"; print "@_" EXPECT a := b := c ######## +eval { $q = pack "q", 0 }; +if ($@) { $cusp = ~0 ^ (~0 >> 1); $, = " "; print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, ($cusp + 1) % 8, "!\n"; +} else { +# We are on a 64-bit platform: fake it. +# (If we have long doubles we might not need to fake it.) +# Background: the $cusp will get converted from a UV into an NV because of +# the subtraction and addition. Taking away or adding 1 from such a large +# NV doesn't actually change the NV, so the modulo fails. +print "7 0 0 1 !\n"; +} EXPECT 7 0 0 1 ! ######## -- cgit v1.2.1 From d3a6a6fe5a9e3ef67f27330d1df0f6940f52d6a2 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 4 Sep 1999 18:04:47 +0000 Subject: use integer on the problematic subtest. p4raw-id: //depot/cfgperl@4075 --- t/op/misc.t | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 46b9a0457d..3c385cd4d3 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -59,21 +59,12 @@ $a = ":="; split /($a)/o, "a:=b:=c"; print "@_" EXPECT a := b := c ######## -eval { $q = pack "q", 0 }; -if ($@) { +use integer; $cusp = ~0 ^ (~0 >> 1); $, = " "; print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, ($cusp + 1) % 8, "!\n"; -} else { -# We are on a 64-bit platform: fake it. -# (If we have long doubles we might not need to fake it.) -# Background: the $cusp will get converted from a UV into an NV because of -# the subtraction and addition. Taking away or adding 1 from such a large -# NV doesn't actually change the NV, so the modulo fails. -print "7 0 0 1 !\n"; -} EXPECT -7 0 0 1 ! +-1 0 0 1 ! ######## $foo=undef; $foo->go; EXPECT -- cgit v1.2.1 From d0ba1bd2be06981094763112f29fa147de3d9441 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sun, 5 Sep 1999 21:30:54 +0000 Subject: Time is not yet ripe. p4raw-id: //depot/cfgperl@4079 --- t/op/misc.t | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 't/op/misc.t') diff --git a/t/op/misc.t b/t/op/misc.t index 3c385cd4d3..926c7f38d0 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -59,12 +59,11 @@ $a = ":="; split /($a)/o, "a:=b:=c"; print "@_" EXPECT a := b := c ######## -use integer; $cusp = ~0 ^ (~0 >> 1); $, = " "; print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, ($cusp + 1) % 8, "!\n"; EXPECT --1 0 0 1 ! +7 0 0 1 ! ######## $foo=undef; $foo->go; EXPECT -- cgit v1.2.1