summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-01-04 17:44:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-04 17:44:00 +1200
commit8ebc5c0145d2e3559bce3073437e6d027dcdffcc (patch)
tree19e91b8b9e9b19b4116b7b4b64f2a4755e6bd179 /t/comp
parent7cfe7857715f78206e6d7d6f7fd52983de4dec44 (diff)
downloadperl-8ebc5c0145d2e3559bce3073437e6d027dcdffcc.tar.gz
[inseparable changes from patch from perl5.003_18 to perl5.003_19]
CORE LANGUAGE CHANGES Subject: Make method cache invisible to user code From: Chip Salzenberg <chip@atlantic.net> Files: dump.c gv.c gv.h hv.c op.c perl.c pp_hot.c pp_sys.c sv.c toke.c Subject: Never parse "{m,s,y,tr,q{,q,w,x}}:{,:}" as package or label From: Chip Salzenberg <chip@atlantic.net> Files: toke.c CORE PORTABILITY Subject: Fix $^X under HP-UX From: Chip Salzenberg <chip@atlantic.net> Files: hints/hpux.sh toke.c Subject: New hints/hpux.sh Date: Tue, 31 Dec 1996 15:09:32 -0800 From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com> Files: hints/hpux.sh private-msgid: <199612312309.AA283393772@hpcc123.corp.hp.com> DOCUMENTATION Subject: Perlguts, version 28 Date: Fri, 3 Jan 1997 13:10:46 -0800 From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com> Files: pod/perlguts.pod private-msgid: <199701032110.AA102535846@hpcc123.corp.hp.com> Subject: Miscellaneous pod patches From: Ralf S. Engelschall <rse@engelschall.com> Files: pod/Makefile pod/perldebug.pod pod/perlfunc.pod pod/perlguts.pod Subject: expanded flock() docs Date: Fri, 03 Jan 1997 19:31:11 -0500 From: Roderick Schertler <roderick@gate.net> Files: pod/perlfunc.pod Msg-ID: <4481.852337871@eeyore.ibcinc.com> (applied based on p5p patch as commit 1fd81fbbe87d964ad1f7dbdce41e36f3781dcf82) Subject: Use Text::Wrap in buildtoc; run buildtoc From: Ulrich Pfeifer <pfeifer@charly.informatik.uni-dortmund.de> Files: pod/buildtoc pod/perltoc.pod Subject: Remove obsolete perlovl.pod From: Chip Salzenberg <chip@atlantic.net> Files: MANIFEST plan9/mkfile pod/perlovl.pod vms/Makefile vms/descrip.mms OTHER CORE CHANGES Subject: Fix segv when calling named closures From: Chip Salzenberg <chip@atlantic.net> Files: pp_hot.c Subject: Finish rationalizing "undef value" warnings From: Chip Salzenberg <chip@atlantic.net> Files: doop.c pp.c sv.c t/op/assignwarn.t Subject: Arrange for all "_<file" entries to be in %main:: From: Chip Salzenberg <chip@atlantic.net> Files: gv.c lib/perl5db.pl Subject: Introduce CVf_NODEBUG flag Date: Wed, 01 Jan 1997 15:42:05 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: cv.h pp_hot.c Msg-ID: <199701012042.PAA25994@aatma.engin.umich.edu> (applied based on p5p patch as commit a3d90dd510fe5a67ed9b80e603493d285c30aa97) Subject: Reword 'may be "0"' warning per Larry; fix its line number From: Chip Salzenberg <chip@atlantic.net> Files: op.c pod/perldiag.pod Subject: 5.003_18: perl_{con,des}truct fixes Date: Fri, 03 Jan 1997 15:42:04 -0500 From: Doug MacEachern <dougm@osf.org> Files: perl.c perl.h pod/perlembed.pod pod/perltoc.pod t/op/sysio.t Msg-ID: <199701032042.PAA06766@postman.osf.org> (applied based on p5p patch as commit 316c7b3d7b47e3143f94c7f8621e854c519d1e87) Subject: Fix lost value from READLINE after TIEHANDLE From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: pp_hot.c sv.h TESTS Subject: Create t/pragma directory; populate with new and old From: Paul Marquess <pmarquess@bfsec.bt.co.uk> Files: MANIFEST Makefile.SH t/TEST t/comp/use.t t/lib/locale.t t/op/overload.t t/op/use.t t/pragma/locale.t t/pragma/overload.t t/pragma/strict-refs t/pragma/strict-subs t/pragma/strict-vars t/pragma/strict.t t/pragma/subs.t t/pragma/warn-global t/pragma/warning.t Subject: New tests: comp/colon.t and op/assignwarn.t From: Robin Barker <rmb@cise.npl.co.uk> Files: MANIFEST t/comp/colon.t t/op/assignwarn.t
Diffstat (limited to 't/comp')
-rwxr-xr-xt/comp/colon.t138
-rw-r--r--t/comp/use.t101
2 files changed, 239 insertions, 0 deletions
diff --git a/t/comp/colon.t b/t/comp/colon.t
index e69de29bb2..2a37367d75 100755
--- a/t/comp/colon.t
+++ b/t/comp/colon.t
@@ -0,0 +1,138 @@
+#!./perl
+
+#
+# Ensure that syntax using colons (:) is parsed correctly.
+# The tests are done on the following tokens (by default):
+# ABC LABEL XYZZY m q qq qw qx s tr y AUTOLOAD and alarm
+# -- Robin Barker <rmb@cise.npl.co.uk>
+#
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+use strict;
+
+$_ = ''; # to avoid undef warning on m// etc.
+
+sub ok {
+ my($test,$ok) = @_;
+ print "not " unless $ok;
+ print "ok $test\n";
+}
+
+$SIG{__WARN__} = sub { 1; }; # avoid some spurious warnings
+
+print "1..25\n";
+
+ok 1, (eval "package ABC; sub zyx {1}; 1;" and
+ eval "ABC::zyx" and
+ not eval "ABC:: eq ABC||" and
+ not eval "ABC::: >= 0");
+
+ok 2, (eval "package LABEL; sub zyx {1}; 1;" and
+ eval "LABEL::zyx" and
+ not eval "LABEL:: eq LABEL||" and
+ not eval "LABEL::: >= 0");
+
+ok 3, (eval "package XYZZY; sub zyx {1}; 1;" and
+ eval "XYZZY::zyx" and
+ not eval "XYZZY:: eq XYZZY||" and
+ not eval "XYZZY::: >= 0");
+
+ok 4, (eval "package m; sub zyx {1}; 1;" and
+ not eval "m::zyx" and
+ eval "m:: eq m||" and
+ not eval "m::: >= 0");
+
+ok 5, (eval "package q; sub zyx {1}; 1;" and
+ not eval "q::zyx" and
+ eval "q:: eq q||" and
+ not eval "q::: >= 0");
+
+ok 6, (eval "package qq; sub zyx {1}; 1;" and
+ not eval "qq::zyx" and
+ eval "qq:: eq qq||" and
+ not eval "qq::: >= 0");
+
+ok 7, (eval "package qw; sub zyx {1}; 1;" and
+ not eval "qw::zyx" and
+ eval "qw:: eq qw||" and
+ not eval "qw::: >= 0");
+
+ok 8, (eval "package qx; sub zyx {1}; 1;" and
+ not eval "qx::zyx" and
+ eval "qx:: eq qx||" and
+ not eval "qx::: >= 0");
+
+ok 9, (eval "package s; sub zyx {1}; 1;" and
+ not eval "s::zyx" and
+ not eval "s:: eq s||" and
+ eval "s::: >= 0");
+
+ok 10, (eval "package tr; sub zyx {1}; 1;" and
+ not eval "tr::zyx" and
+ not eval "tr:: eq tr||" and
+ eval "tr::: >= 0");
+
+ok 11, (eval "package y; sub zyx {1}; 1;" and
+ not eval "y::zyx" and
+ not eval "y:: eq y||" and
+ eval "y::: >= 0");
+
+ok 12, (eval "ABC:1" and
+ not eval "ABC:echo: eq ABC|echo|" and
+ not eval "ABC:echo:ohce: >= 0");
+
+ok 13, (eval "LABEL:1" and
+ not eval "LABEL:echo: eq LABEL|echo|" and
+ not eval "LABEL:echo:ohce: >= 0");
+
+ok 14, (eval "XYZZY:1" and
+ not eval "XYZZY:echo: eq XYZZY|echo|" and
+ not eval "XYZZY:echo:ohce: >= 0");
+
+ok 15, (not eval "m:1" and
+ eval "m:echo: eq m|echo|" and
+ not eval "m:echo:ohce: >= 0");
+
+ok 16, (not eval "q:1" and
+ eval "q:echo: eq q|echo|" and
+ not eval "q:echo:ohce: >= 0");
+
+ok 17, (not eval "qq:1" and
+ eval "qq:echo: eq qq|echo|" and
+ not eval "qq:echo:ohce: >= 0");
+
+ok 18, (not eval "qw:1" and
+ eval "qw:echo: eq qw|echo|" and
+ not eval "qw:echo:ohce: >= 0");
+
+ok 19, (not eval "qx:1" and
+ eval "qx:echo: eq qx|echo|" and
+ not eval "qx:echo:ohce: >= 0");
+
+ok 20, (not eval "s:1" and
+ not eval "s:echo: eq s|echo|" and
+ eval "s:echo:ohce: >= 0");
+
+ok 21, (not eval "tr:1" and
+ not eval "tr:echo: eq tr|echo|" and
+ eval "tr:echo:ohce: >= 0");
+
+ok 22, (not eval "y:1" and
+ not eval "y:echo: eq y|echo|" and
+ eval "y:echo:ohce: >= 0");
+
+ok 23, (eval "AUTOLOAD:1" and
+ not eval "AUTOLOAD:echo: eq AUTOLOAD|echo|" and
+ not eval "AUTOLOAD:echo:ohce: >= 0");
+
+ok 24, (eval "and:1" and
+ not eval "and:echo: eq and|echo|" and
+ not eval "and:echo:ohce: >= 0");
+
+ok 25, (eval "alarm:1" and
+ not eval "alarm:echo: eq alarm|echo|" and
+ not eval "alarm:echo:ohce: >= 0");
diff --git a/t/comp/use.t b/t/comp/use.t
new file mode 100644
index 0000000000..a6ce2a4d56
--- /dev/null
+++ b/t/comp/use.t
@@ -0,0 +1,101 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+print "1..14\n";
+
+my $i = 1;
+
+eval "use 5.000;";
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+eval sprintf "use %.5f;", $];
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+
+eval sprintf "use %.5f;", $] - 0.000001;
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+eval sprintf("use %.5f;", $] + 1);
+unless ($@) {
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+eval sprintf "use %.5f;", $] + 0.00001;
+unless ($@) {
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+
+
+use lib; # I know that this module will be there.
+
+
+local $lib::VERSION = 1.0;
+
+eval "use lib 0.9";
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+eval "use lib 1.0";
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+eval "use lib 1.01";
+unless ($@) {
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+
+eval "use lib 0.9 qw(fred)";
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+print "not " unless $INC[0] eq "fred";
+print "ok ",$i++,"\n";
+
+eval "use lib 1.0 qw(joe)";
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+print "not " unless $INC[0] eq "joe";
+print "ok ",$i++,"\n";
+
+eval "use lib 1.01 qw(freda)";
+unless ($@) {
+ print "not ";
+}
+print "ok ",$i++,"\n";
+
+print "not " if $INC[0] eq "freda";
+print "ok ",$i++,"\n";