summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-07-13 06:24:18 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-07-13 06:24:18 +0000
commit6f19801bde5f6175a1b7ed9b1b87cdae036fd9bf (patch)
tree206e5ec4377db1e5c29d7ed9453fa4f6d0aeba89 /t
parent76af18c5f83726ca5cce63423ad1e5a77c21fe10 (diff)
parentb8adaf87fdcc698bca3bf69110c0b4cdb1d0225d (diff)
downloadperl-6f19801bde5f6175a1b7ed9b1b87cdae036fd9bf.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@11345
Diffstat (limited to 't')
-rw-r--r--t/lib/1_compile.t19
-rw-r--r--t/lib/warnings/util50
-rwxr-xr-xt/op/splice.t16
3 files changed, 81 insertions, 4 deletions
diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t
index 0132fb9a28..81c6f416c0 100644
--- a/t/lib/1_compile.t
+++ b/t/lib/1_compile.t
@@ -80,7 +80,6 @@ unless (has_extension('NDBM_File')) {
}
delete_by_prefix('unicode::');
-add_by_name('unicode::distinct'); # put this back
# Delete all modules which have their own tests.
# This makes this test a lot faster.
@@ -108,7 +107,9 @@ foreach my $module (@Core_Modules) {
sub compile_module {
my ($module) = $_[0];
- return scalar `$^X "-Ilib" t/lib/compmod.pl $module` =~ /^ok/;
+ my $out = scalar `$^X "-Ilib" t/lib/compmod.pl $module`;
+ print "# $out";
+ return $out =~ /^ok/;
}
# Add here modules that have their own test scripts and therefore
@@ -173,6 +174,7 @@ Getopt::Long
Getopt::Std
I18N::Langinfo
I18N::LangTags
+I18N::LangTags::List
I18N::Collate
IO::Dir
IO::File
@@ -197,8 +199,17 @@ MIME::Base64
MIME::QuotedPrint
Math::BigFloat
Math::BigInt
+Math::BigInt::Calc
Math::Complex
Math::Trig
+Memoize
+Memoize::AnyDBM_File
+Memoize::Expire
+Memoize::ExpireFile
+Memoize::ExpireTest
+Memoize::NDBM_File
+Memoize::SDBM_File
+Memoize::Storable
NDBM_File
NEXT
Net::hostent
@@ -228,6 +239,8 @@ Sys::Syslog
Term::ANSIColor
Test
Test::Harness
+Test::More
+Test::Simple
Test::ParseWords
Text::Abbrev
Text::Balanced
@@ -248,7 +261,7 @@ Time::Piece
Time::gmtime
Time::localtime
Time::tm
-Unicode::UCD
+UnicodeCD
UNIVERSAL
User::grent
User::pwent
diff --git a/t/lib/warnings/util b/t/lib/warnings/util
index e82d6a6617..4e960c1ea1 100644
--- a/t/lib/warnings/util
+++ b/t/lib/warnings/util
@@ -106,3 +106,53 @@ no warnings 'portable' ;
$a = oct "0047777777777" ;
EXPECT
Octal number > 037777777777 non-portable at - line 5.
+########
+# util.c
+use warnings;
+$x = 1;
+if ($x) {
+ print $y;
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 5.
+Use of uninitialized value in print at - line 5.
+########
+# util.c
+use warnings;
+$x = 1;
+if ($x) {
+ $x++;
+ print $y;
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 6.
+Use of uninitialized value in print at - line 6.
+########
+# util.c
+use warnings;
+$x = 0;
+if ($x) {
+ print "1\n";
+} elsif (!$x) {
+ print $y;
+} else {
+ print "0\n";
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 7.
+Use of uninitialized value in print at - line 7.
+########
+# util.c
+use warnings;
+$x = 0;
+if ($x) {
+ print "1\n";
+} elsif (!$x) {
+ $x++;
+ print $y;
+} else {
+ print "0\n";
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 8.
+Use of uninitialized value in print at - line 8.
diff --git a/t/op/splice.t b/t/op/splice.t
index 3b4229a031..d1bfe999e5 100755
--- a/t/op/splice.t
+++ b/t/op/splice.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..10\n";
+print "1..12\n";
@a = (1..10);
@@ -37,4 +37,18 @@ print "ok 9\n";
print "not " unless j(splice(@a)) eq j(1,2,7,3) && j(@a) eq '';
print "ok 10\n";
+# Tests 11 and 12:
+# [ID 20010711.005] in Tie::Array, SPLICE ignores context, breaking SHIFT
+
+my $foo;
+
+@a = ('red', 'green', 'blue');
+$foo = splice @a, 1, 2;
+print "not " unless $foo eq 'blue';
+print "ok 11\n";
+
+@a = ('red', 'green', 'blue');
+$foo = shift @a;
+print "not " unless $foo eq 'red';
+print "ok 12\n";