r47207 - in /branches/upstream/libscalar-list-utils-perl/current: ./ lib/List/ lib/List/Util/ lib/Scalar/ lib/Scalar/Util/ t/
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Sun Nov 15 12:43:02 UTC 2009
Author: carnil-guest
Date: Sun Nov 15 12:42:46 2009
New Revision: 47207
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47207
Log:
[svn-upgrade] Integrating new upstream version, libscalar-list-utils-perl (1.22)
Modified:
branches/upstream/libscalar-list-utils-perl/current/Changes
branches/upstream/libscalar-list-utils-perl/current/ListUtil.xs
branches/upstream/libscalar-list-utils-perl/current/MANIFEST
branches/upstream/libscalar-list-utils-perl/current/META.yml
branches/upstream/libscalar-list-utils-perl/current/SIGNATURE
branches/upstream/libscalar-list-utils-perl/current/lib/List/Util.pm
branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/PP.pm
branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/XS.pm
branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util.pm
branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util/PP.pm
branches/upstream/libscalar-list-utils-perl/current/t/dualvar.t
branches/upstream/libscalar-list-utils-perl/current/t/first.t
branches/upstream/libscalar-list-utils-perl/current/t/lln.t
branches/upstream/libscalar-list-utils-perl/current/t/p_tainted.t
branches/upstream/libscalar-list-utils-perl/current/t/reduce.t
Modified: branches/upstream/libscalar-list-utils-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/Changes?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/Changes (original)
+++ branches/upstream/libscalar-list-utils-perl/current/Changes Sun Nov 15 12:42:46 2009
@@ -1,3 +1,11 @@
+1.22 -- Sat Nov 14 09:26:15 CST 2009
+
+ * silence a compiler warning about an unreferenced local variable [Steve Hay]
+ * RT#51484 Preserve utf8 flag of string passed to dualvar()
+ * RT#51454 Check first argument to first/reduce is a code reference
+ * RT#50528 [PATCH] p_tainted.t fix for VMS [Craig A. Berry]
+ * RT#48550 fix pure perl looks_like_number not to match non-ascii digits
+
1.21 -- Mon May 18 10:32:14 CDT 2009
* Change build system for perl-only install not to need to modify blib
Modified: branches/upstream/libscalar-list-utils-perl/current/ListUtil.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/ListUtil.xs?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/ListUtil.xs (original)
+++ branches/upstream/libscalar-list-utils-perl/current/ListUtil.xs Sun Nov 15 12:42:46 2009
@@ -194,7 +194,6 @@
SV *sv;
SV *retsv = NULL;
int index;
- int magic;
NV retval = 0;
if(!items) {
XSRETURN_UNDEF;
@@ -334,6 +333,9 @@
XSRETURN_UNDEF;
}
cv = sv_2cv(block, &stash, &gv, 0);
+ if (cv == Nullcv) {
+ croak("Not a subroutine reference");
+ }
PUSH_MULTICALL(cv);
SAVESPTR(GvSV(PL_defgv));
@@ -406,6 +408,8 @@
ST(0) = sv_newmortal();
(void)SvUPGRADE(ST(0),SVt_PVNV);
sv_setpvn(ST(0),ptr,len);
+ if (SvUTF8(str))
+ SvUTF8_on(ST(0));
if(SvNOK(num) || SvPOK(num) || SvMAGICAL(num)) {
SvNV_set(ST(0), SvNV(num));
SvNOK_on(ST(0));
Modified: branches/upstream/libscalar-list-utils-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/MANIFEST?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/MANIFEST (original)
+++ branches/upstream/libscalar-list-utils-perl/current/MANIFEST Sun Nov 15 12:42:46 2009
@@ -6,7 +6,7 @@
lib/Scalar/Util/PP.pm
ListUtil.xs
Makefile.PL
-MANIFEST
+MANIFEST This list of files
multicall.h
README
t/00version.t
Modified: branches/upstream/libscalar-list-utils-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/META.yml?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/META.yml (original)
+++ branches/upstream/libscalar-list-utils-perl/current/META.yml Sun Nov 15 12:42:46 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Scalar-List-Utils
-version: 1.21
+version: 1.22
abstract: Common Scalar and List utility subroutines
author:
- Graham Barr <gbarr at cpan.org>
Modified: branches/upstream/libscalar-list-utils-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/SIGNATURE?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/SIGNATURE (original)
+++ branches/upstream/libscalar-list-utils-perl/current/SIGNATURE Sun Nov 15 12:42:46 2009
@@ -14,26 +14,26 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 b4eb6689a17058a930c9877989de090ab827c003 Changes
-SHA1 62fa0b31d96ecc2f7ed2921e865d2fb839428106 ListUtil.xs
-SHA1 288465c607fa60b699a765883a8009f4055f21aa MANIFEST
-SHA1 fc5cb2963ca63f590fa0796899ae9dc0a1c8fde7 META.yml
+SHA1 facaaaed47a04057860c070328463d5c3605eabb Changes
+SHA1 faf2e17869e969c5d27612d3ec5b3d2026b2abbc ListUtil.xs
+SHA1 0f3bae3ec5030a45e73e7eadffd03dd5bc0ea769 MANIFEST
+SHA1 a2a0eda95a627fcb80b27cc65c58ef3d301d8086 META.yml
SHA1 a776a81ab39fa970ccb3f3229e3638dbd33dc483 Makefile.PL
SHA1 9ab2ca5f2af3bd41a763382158f2c6bc1ba36f41 README
SHA1 61f69d6e90bacbcc85be1baa75cc5db11818beac XS.pp
-SHA1 b682b7f5d309984e731d85b1018b52cf47eec9c3 lib/List/Util.pm
-SHA1 a3af86dd16c8e83987f83d8a5f293461eaa2e297 lib/List/Util/PP.pm
-SHA1 09eee2f86cb7e78836947bb89f064d17dfb1b088 lib/List/Util/XS.pm
-SHA1 9527543103055f9f533bd614ed87d64955ab110b lib/Scalar/Util.pm
-SHA1 8c639fefafbd51b708cc55feda4cf563e5c4258c lib/Scalar/Util/PP.pm
+SHA1 f787f6b9871bce8734fdeff01cda2105f2ceabf0 lib/List/Util.pm
+SHA1 e7f20766416700a6673bf5e5d767e2edd42d4248 lib/List/Util/PP.pm
+SHA1 9e17c6c3fd382fc366479f1a418260387717e6ef lib/List/Util/XS.pm
+SHA1 c6e8c1c3e97eebf2f9b96331e693aa0944080725 lib/Scalar/Util.pm
+SHA1 ed50f05c578d481aa55343eb8b3ec7c51eb23933 lib/Scalar/Util/PP.pm
SHA1 b0fa4782bf655d5d6356b200d3a0375d31b6ec15 multicall.h
SHA1 7e3ac53646e628df2c5e4bd4783ef08a10c8e195 t/00version.t
SHA1 5ea6b4cb8a3095fc007e20cb802831affe3cc8ef t/blessed.t
-SHA1 2ebd79ff57241a850957549916d884e9968abbbc t/dualvar.t
+SHA1 a839163d3f96339ee4fd6926d6ba3341af4210b8 t/dualvar.t
SHA1 ac1038ceaec651d3c8a7a9e3359eb91519cce090 t/expfail.t
-SHA1 55ab8be1b810f350afe8a4e12eb03d67def93f81 t/first.t
+SHA1 d9df7844d53870d57e5991d2bc2397c61a9dbaec t/first.t
SHA1 8c5cc4ac342118b5251e69060b9fef4027d28eb4 t/isvstring.t
-SHA1 7e2aa811476460ca0064c38ee273e6d9787fab4c t/lln.t
+SHA1 cbbb3a1ab3652f886b93e9f48eca086d0e392975 t/lln.t
SHA1 8957c8a42a557b4e474afe1effc9d00a451092e8 t/max.t
SHA1 9dc923c7b6dda504fb6e1cf78e7e2d315e69c3aa t/maxstr.t
SHA1 e3813e3a977d2bd6d80b9ae2a20b3351b94a897f t/min.t
@@ -54,10 +54,10 @@
SHA1 5b6bcbb5c6c2eb48c6d5fa83bf092dc412c4f12a t/p_reftype.t
SHA1 5b6bcbb5c6c2eb48c6d5fa83bf092dc412c4f12a t/p_shuffle.t
SHA1 5b6bcbb5c6c2eb48c6d5fa83bf092dc412c4f12a t/p_sum.t
-SHA1 65ac3a14d6b710e87dd8a9ba0d3f50d3ea01857d t/p_tainted.t
+SHA1 0507c8eaa2947985f5a2e7a1530e11f4ddd59302 t/p_tainted.t
SHA1 7809e3b5c0177599cbc1f22ea00760e0ef0c6b7b t/proto.t
SHA1 4c8b290754eeeb20f31dc47e1147c6e7a94a6dac t/readonly.t
-SHA1 533187902cbc5330f2ae4cca8e4755350035bc97 t/reduce.t
+SHA1 75b2d63a506ee16bded9d5aabc66b0d58e31c837 t/reduce.t
SHA1 03944068c5b2ef9fd01b0fa08e7f5323c3a88f4a t/refaddr.t
SHA1 c92cda39695a2f1bfa2a585cf93cf4e57f0c023b t/reftype.t
SHA1 841e0a7d5d1d4ad5a4678cabd3af62043d050938 t/shuffle.t
@@ -66,9 +66,9 @@
SHA1 0eea44585f74f033212ae82865366a7cff4b7dfd t/tainted.t
SHA1 edffd9f72e6233215bba3fe3535e1c37e3245a39 t/weak.t
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.9 (Darwin)
+Version: GnuPG v1.4.10 (Darwin)
-iEYEARECAAYFAkoRf+gACgkQR0BL4gbYw3RVcwCcCtEhNASMmYzMTLok+NO42tR/
-mkcAniFFAst3ujOkv1cqJk8k91fPANYc
-=TImz
+iEYEARECAAYFAkr+zOkACgkQR0BL4gbYw3TuoQCfT4TIAlH+OWNvJrCE9WPjYpCD
+NCsAnjEEO+6wQa7n7ycTAugwa4Dy6p5z
+=ROh1
-----END PGP SIGNATURE-----
Modified: branches/upstream/libscalar-list-utils-perl/current/lib/List/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/lib/List/Util.pm?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/lib/List/Util.pm (original)
+++ branches/upstream/libscalar-list-utils-perl/current/lib/List/Util.pm Sun Nov 15 12:42:46 2009
@@ -14,7 +14,7 @@
@ISA = qw(Exporter);
@EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.21";
+$VERSION = "1.22";
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
Modified: branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/PP.pm?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/PP.pm (original)
+++ branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/PP.pm Sun Nov 15 12:42:46 2009
@@ -13,12 +13,14 @@
@ISA = qw(Exporter);
@EXPORT = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.21";
+$VERSION = "1.22";
$VERSION = eval $VERSION;
sub reduce (&@) {
my $code = shift;
- unless(ref($code)) {
+ require Scalar::Util;
+ my $type = Scalar::Util::reftype($code);
+ unless($type and $type eq 'CODE') {
require Carp;
Carp::croak("Not a subroutine reference");
}
@@ -43,6 +45,12 @@
sub first (&@) {
my $code = shift;
+ require Scalar::Util;
+ my $type = Scalar::Util::reftype($code);
+ unless($type and $type eq 'CODE') {
+ require Carp;
+ Carp::croak("Not a subroutine reference");
+ }
foreach (@_) {
return $_ if &{$code}();
Modified: branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/XS.pm?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/XS.pm (original)
+++ branches/upstream/libscalar-list-utils-perl/current/lib/List/Util/XS.pm Sun Nov 15 12:42:46 2009
@@ -3,7 +3,7 @@
use vars qw($VERSION);
use List::Util;
-$VERSION = "1.21"; # FIXUP
+$VERSION = "1.22"; # FIXUP
$VERSION = eval $VERSION; # FIXUP
sub _VERSION { # FIXUP
Modified: branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util.pm?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util.pm (original)
+++ branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util.pm Sun Nov 15 12:42:46 2009
@@ -13,7 +13,7 @@
@ISA = qw(Exporter);
@EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle refaddr isvstring looks_like_number set_prototype);
-$VERSION = "1.21";
+$VERSION = "1.22";
$VERSION = eval $VERSION;
unless (defined &dualvar) {
Modified: branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util/PP.pm?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util/PP.pm (original)
+++ branches/upstream/libscalar-list-utils-perl/current/lib/Scalar/Util/PP.pm Sun Nov 15 12:42:46 2009
@@ -16,7 +16,7 @@
@ISA = qw(Exporter);
@EXPORT = qw(blessed reftype tainted readonly refaddr looks_like_number);
-$VERSION = "1.21";
+$VERSION = "1.22";
$VERSION = eval $VERSION;
sub blessed ($) {
@@ -98,8 +98,8 @@
require overload;
return overload::Overloaded($_) ? defined(0 + $_) : 0;
}
- return 1 if (/^[+-]?\d+$/); # is a +/- integer
- return 1 if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/); # a C float
+ return 1 if (/^[+-]?[0-9]+$/); # is a +/- integer
+ return 1 if (/^([+-]?)(?=[0-9]|\.[0-9])[0-9]*(\.[0-9]*)?([Ee]([+-]?[0-9]+))?$/); # a C float
return 1 if ($] >= 5.008 and /^(Inf(inity)?|NaN)$/i) or ($] >= 5.006001 and /^Inf$/i);
0;
Modified: branches/upstream/libscalar-list-utils-perl/current/t/dualvar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/t/dualvar.t?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/t/dualvar.t (original)
+++ branches/upstream/libscalar-list-utils-perl/current/t/dualvar.t Sun Nov 15 12:42:46 2009
@@ -16,7 +16,7 @@
use Scalar::Util ();
use Test::More (grep { /dualvar/ } @Scalar::Util::EXPORT_FAIL)
? (skip_all => 'dualvar requires XS version')
- : (tests => 11);
+ : (tests => 13);
Scalar::Util->import('dualvar');
@@ -49,13 +49,22 @@
ok( $var > 0, 'UV 2');
}
+
+{
+ package Tied;
+
+ sub TIESCALAR { bless {} }
+ sub FETCH { 7.5 }
+}
+
tie my $tied, 'Tied';
$var = dualvar($tied, "ok");
ok($var == 7.5, 'Tied num');
ok($var eq 'ok', 'Tied str');
-package Tied;
-sub TIESCALAR { bless {} }
-sub FETCH { 7.5 }
-
+SKIP: {
+ skip("need utf8::is_utf8",2) unless defined &utf8::is_utf8;
+ ok(!!utf8::is_utf8(dualvar(1,chr(400))), 'utf8');
+ ok( !utf8::is_utf8(dualvar(1,"abc")), 'not utf8');
+}
Modified: branches/upstream/libscalar-list-utils-perl/current/t/first.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/t/first.t?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/t/first.t (original)
+++ branches/upstream/libscalar-list-utils-perl/current/t/first.t Sun Nov 15 12:42:46 2009
@@ -15,7 +15,7 @@
use List::Util qw(first);
use Test::More;
-plan tests => ($::PERL_ONLY ? 15 : 17);
+plan tests => 19 + ($::PERL_ONLY ? 0 : 2);
my $v;
ok(defined &first, 'defined');
@@ -113,3 +113,13 @@
like($@, qr/^Can't goto subroutine from a sort sub/, "goto sub");
} }
+
+eval { &first(1,2) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &first(qw(a b)) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &first([],1,2,3) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &first(+{},1,2,3) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+
Modified: branches/upstream/libscalar-list-utils-perl/current/t/lln.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/t/lln.t?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/t/lln.t (original)
+++ branches/upstream/libscalar-list-utils-perl/current/t/lln.t Sun Nov 15 12:42:46 2009
@@ -14,7 +14,7 @@
}
use strict;
-use Test::More tests => 18;
+use Test::More tests => 19;
use Scalar::Util qw(looks_like_number);
foreach my $num (qw(1 -1 +1 1.0 +1.0 -1.0 -1.0e-12)) {
@@ -43,4 +43,6 @@
is(!!looks_like_number($foo{'abc'}), '', 'Tied');
is(!!looks_like_number($foo{'123'}), 1, 'Tied');
+is(!!looks_like_number("\x{1815}"), '', 'MONGOLIAN DIGIT FIVE');
+
# We should copy some of perl core tests like t/base/num.t here
Modified: branches/upstream/libscalar-list-utils-perl/current/t/p_tainted.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/t/p_tainted.t?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/t/p_tainted.t (original)
+++ branches/upstream/libscalar-list-utils-perl/current/t/p_tainted.t Sun Nov 15 12:42:46 2009
@@ -6,7 +6,7 @@
$List::Util::TESTING_PERL_ONLY = $List::Util::TESTING_PERL_ONLY = 1;
(my $f = __FILE__) =~ s/p_//;
-my $filename = $^O eq 'MSWin32'
+my $filename = ($^O eq 'MSWin32' || $^O eq 'VMS')
? File::Spec->rel2abs(File::Spec->catfile(".", $f))
: File::Spec->catfile(".", $f);
do $filename; die $@ if $@;
Modified: branches/upstream/libscalar-list-utils-perl/current/t/reduce.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-list-utils-perl/current/t/reduce.t?rev=47207&op=diff
==============================================================================
--- branches/upstream/libscalar-list-utils-perl/current/t/reduce.t (original)
+++ branches/upstream/libscalar-list-utils-perl/current/t/reduce.t Sun Nov 15 12:42:46 2009
@@ -16,7 +16,7 @@
use List::Util qw(reduce min);
use Test::More;
-plan tests => ($::PERL_ONLY ? 23 : 25);
+plan tests => 27 + ($::PERL_ONLY ? 0 : 2);
my $v = reduce {};
@@ -150,3 +150,13 @@
like($@, qr/^Can't goto subroutine from a sort sub/, "goto sub");
} }
+
+eval { &reduce(1,2) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &reduce(qw(a b)) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &reduce([],1,2,3) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+eval { &reduce(+{},1,2,3) };
+ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
+
More information about the Pkg-perl-cvs-commits
mailing list