Hello community, here is the log from the commit of package perl-List-MoreUtils-XS for openSUSE:Factory checked in at 2017-09-13 21:36:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-List-MoreUtils-XS (Old) and /work/SRC/openSUSE:Factory/.perl-List-MoreUtils-XS.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-List-MoreUtils-XS" Wed Sep 13 21:36:07 2017 rev:3 rq:523621 version:0.423 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-List-MoreUtils-XS/perl-List-MoreUtils-XS.changes 2017-09-05 15:13:31.615517859 +0200 +++ /work/SRC/openSUSE:Factory/.perl-List-MoreUtils-XS.new/perl-List-MoreUtils-XS.changes 2017-09-13 21:36:23.667041529 +0200 @@ -1,0 +2,25 @@ +Tue Sep 12 08:16:32 UTC 2017 - sch...@suse.de + +- format.patch: fix format errors +- undefined.patch: fix undefined operation + +------------------------------------------------------------------- +Mon Sep 4 05:39:47 UTC 2017 - co...@suse.com + +- updated to 0.423 + see /usr/share/doc/packages/perl-List-MoreUtils-XS/Changes + + 0.423 2017-08-19 + - Fix dealing with lists with one element on bremove/binsert. + Thanks shawnlaffan for reporting this via issues#2 + - add support for compilers before C99 + - fix some 32-bit compiler warnings + - add support for compilers without statement expression feature + + 0.422 2017-08-15 + - Rename 'occurances' into 'occurrences' as requested in RT#122806 by + Paul Howarth as a slightly late side-note in RT#91991. + - Add DESCRIPTION to Pod clarifying the role of List::MoreUtils::XS + - improve Makefile.PL regarding some build artifacts + +------------------------------------------------------------------- Old: ---- List-MoreUtils-XS-0.421.tar.gz New: ---- List-MoreUtils-XS-0.423.tar.gz format.patch undefined.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-List-MoreUtils-XS.spec ++++++ --- /var/tmp/diff_new_pack.ROevrO/_old 2017-09-13 21:36:24.562915481 +0200 +++ /var/tmp/diff_new_pack.ROevrO/_new 2017-09-13 21:36:24.562915481 +0200 @@ -17,7 +17,7 @@ Name: perl-List-MoreUtils-XS -Version: 0.421 +Version: 0.423 Release: 0 #Upstream: Apache-2.0 %define cpan_name List-MoreUtils-XS @@ -27,6 +27,8 @@ Url: http://search.cpan.org/dist/List-MoreUtils-XS/ Source0: https://cpan.metacpan.org/authors/id/R/RE/REHSACK/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml +Patch0: format.patch +Patch1: undefined.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros @@ -37,10 +39,15 @@ %{perl_requires} %description -Provide compiled List::MoreUtils functions +List::MoreUtils::XS is a backend for List::MoreUtils. Even if it's possible +(because of user wishes) to have it practically independent from +List::MoreUtils, it technically depend on 'List::MoreUtils'. Since it's +only a backend, the API is not public and can change without any warning. %prep %setup -q -n %{cpan_name}-%{version} +%patch0 -p1 +%patch1 -p1 %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" ++++++ List-MoreUtils-XS-0.421.tar.gz -> List-MoreUtils-XS-0.423.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/Changes new/List-MoreUtils-XS-0.423/Changes --- old/List-MoreUtils-XS-0.421/Changes 2017-08-14 22:16:55.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/Changes 2017-08-19 08:55:27.000000000 +0200 @@ -1,5 +1,18 @@ Revision history for Perl extension List-MoreUtils-XS +0.423 2017-08-19 + - Fix dealing with lists with one element on bremove/binsert. + Thanks shawnlaffan for reporting this via issues#2 + - add support for compilers before C99 + - fix some 32-bit compiler warnings + - add support for compilers without statement expression feature + +0.422 2017-08-15 + - Rename 'occurances' into 'occurrences' as requested in RT#122806 by + Paul Howarth as a slightly late side-note in RT#91991. + - Add DESCRIPTION to Pod clarifying the role of List::MoreUtils::XS + - improve Makefile.PL regarding some build artifacts + 0.421 2017-08-14 - correct license in META thanks to Chase Whitener (RT#122702) - fix issues with -DPERL_IMPLICIT_SYS on Windows with Strawberry-Perl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/MANIFEST new/List-MoreUtils-XS-0.423/MANIFEST --- old/List-MoreUtils-XS-0.421/MANIFEST 2017-08-14 22:19:13.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/MANIFEST 2017-08-19 08:56:18.000000000 +0200 @@ -54,7 +54,7 @@ t/inline/none_u.pm t/inline/notall.pm t/inline/notall_u.pm -t/inline/occurances.pm +t/inline/occurrences.pm t/inline/one.pm t/inline/one_u.pm t/inline/onlyidx.pm @@ -115,7 +115,7 @@ t/xs/none_u.t t/xs/notall.t t/xs/notall_u.t -t/xs/occurances.t +t/xs/occurrences.t t/xs/one.t t/xs/one_u.t t/xs/onlyidx.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/META.json new/List-MoreUtils-XS-0.423/META.json --- old/List-MoreUtils-XS-0.421/META.json 2017-08-14 22:19:13.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/META.json 2017-08-19 08:56:18.000000000 +0200 @@ -84,6 +84,6 @@ "web" : "https://github.com/perl5-utils/List-MoreUtils-XS" } }, - "version" : "0.421", + "version" : "0.423", "x_serialization_backend" : "JSON::PP version 2.94" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/META.yml new/List-MoreUtils-XS-0.423/META.yml --- old/List-MoreUtils-XS-0.421/META.yml 2017-08-14 22:19:12.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/META.yml 2017-08-19 08:56:18.000000000 +0200 @@ -33,5 +33,5 @@ bugtracker: https://rt.cpan.org/Dist/Display.html?Name=List-MoreUtils-XS homepage: https://metacpan.org/release/List-MoreUtils-XS repository: https://github.com/perl5-utils/List-MoreUtils-XS.git -version: '0.421' +version: '0.423' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/Makefile.PL new/List-MoreUtils-XS-0.423/Makefile.PL --- old/List-MoreUtils-XS-0.421/Makefile.PL 2017-08-03 21:42:49.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/Makefile.PL 2017-08-15 15:35:41.000000000 +0200 @@ -154,7 +154,7 @@ XS => {map { (my $tgt = $_) =~ s/\.xs$/\.c/; $_ => $tgt; } @XS_FILES}, MAGICXS => 1, INC => "-I.", - (-d "Sandbox" ? (realclean => {FILES => "inc/latest* inc/inc_* t/xs"}) : ()), + (-d "Sandbox" ? (realclean => {FILES => "inc/latest* inc/inc_* t/xs config.log LMUconfig.h M*.bak"}) : ()), depend => {'$(FIRST_MAKEFILE)' => '$(VERSION_FROM)'}, test => {TESTS => join(' ', 't/*.t', 't/xs/*.t', 'xt/*.t')}, # Otherwise 'cxinc' isn't defined diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/README.md new/List-MoreUtils-XS-0.423/README.md --- old/List-MoreUtils-XS-0.421/README.md 2017-07-25 20:55:57.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/README.md 2017-08-15 15:33:02.000000000 +0200 @@ -23,9 +23,16 @@ my $i = firstidx { $_ eq 'yeah' } @foo; # on sorted - always first, but might not be 'yeah' my $j = lower_bound { $_ cmp 'yeah' } @bar; - # on sorted - any of occurances, is surely 'yeah' + # on sorted - any of occurrences, is surely 'yeah' my $k = bsearchidx { $_ cmp 'yeah' } @bar; +# DESCRIPTION + +List::MoreUtils::XS is a backend for List::MoreUtils. Even if it's possible +(because of user wishes) to have it practically independent from +[List::MoreUtils](https://metacpan.org/pod/List::MoreUtils), it technically depend on `List::MoreUtils`. Since it's +only a backend, the API is not public and can change without any warning. + # SEE ALSO [List::Util](https://metacpan.org/pod/List::Util), [List::AllUtils](https://metacpan.org/pod/List::AllUtils) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/XS.xs new/List-MoreUtils-XS-0.423/XS.xs --- old/List-MoreUtils-XS-0.421/XS.xs 2017-08-14 19:19:49.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/XS.xs 2017-08-18 12:40:54.000000000 +0200 @@ -41,6 +41,9 @@ #ifndef MAX # define MAX(a,b) ((a)>(b)?(a):(b)) #endif +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif #ifndef aTHX # define aTHX @@ -120,6 +123,35 @@ # define GV_NOTQUAL 0 #endif +#ifdef _MSC_VER +# define inline __inline +#endif + +#ifndef HAVE_SIZE_T +# if SIZEOF_PTR == SIZEOF_LONG_LONG +typedef unsigned long long size_t; +# elif SIZEOF_PTR == SIZEOF_LONG +typedef unsigned long size_t; +# elif SIZEOF_PTR == SIZEOF_INT +typedef unsigned int size_t; +# else +# error "Can't determine type for size_t" +# endif +#endif + +#ifndef HAVE_SSIZE_T +# if SIZEOF_PTR == SIZEOF_LONG_LONG +typedef signed long long ssize_t; +# elif SIZEOF_PTR == SIZEOF_LONG +typedef signed long ssize_t; +# elif SIZEOF_PTR == SIZEOF_INT +typedef signed int ssize_t; +# else +# error "Can't determine type for ssize_t" +# endif +#endif + + /* compare left and right SVs. Returns: * -1: < * 0: == @@ -587,10 +619,6 @@ * SUCH DAMAGE. */ -#ifndef MIN -# define MIN(a,b) (((a)<(b))?(a):(b)) -#endif - /* * FreeBSD's Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". * Modified for using Perl Sub (no XSUB) via MULTICALL and all values are SV ** @@ -618,12 +646,23 @@ #define vecswap(a, b, n) \ if ((n) > 0) swapfunc(a, b, n) -#define CMP(x, y) ({ \ +#if HAVE_FEATURE_STATEMENT_EXPRESSION +# define CMP(x, y) ({ \ GvSV(PL_firstgv) = *(x); \ GvSV(PL_secondgv) = *(y); \ MULTICALL; \ SvIV(*PL_stack_sp); \ }) +#else +static inline int _cmpsvs(pTHX_ SV *x, SV *y, OP *multicall_cop ) +{ + GvSV(PL_firstgv) = x; + GvSV(PL_secondgv) = y; + MULTICALL; + return SvIV(*PL_stack_sp); +} +# define CMP(x, y) _cmpsvs(aTHX_ *(x), *(y), multicall_cop) +#endif #define MED3(a, b, c) ( \ CMP(a, b) < 0 ? \ @@ -1964,7 +2003,7 @@ } void -occurances (...) +occurrences (...) PROTOTYPE: @ CODE: { @@ -2091,7 +2130,7 @@ I32 i; if( k > (items - 1) ) - croak("Cannot get %d samples from %d elements", k, items-1); + croak(aTHX_ "Cannot get %" IVdf " samples from %" IVdf " elements", (IV)k, (IV)(items-1)); /* Initialize Drand01 unless rand() or srand() has already been called */ if(!PL_srand_called) @@ -2502,7 +2541,12 @@ RETVAL = -1; - if (AvFILLp(list) > 0) + if (AvFILLp(list) == -1) + { + av_push(list, newSVsv(item)); + RETVAL = 0; + } + else if (AvFILLp(list) >= 0) { dMULTICALL; dMULTICALLSVCV; @@ -2535,7 +2579,7 @@ if(!codelike(code)) croak_xs_usage(cv, "code, ..."); - if (AvFILLp(list) > 0) + if (AvFILLp(list) >= 0) { dMULTICALL; dMULTICALLSVCV; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/inc/Config/AutoConf/LMU.pm new/List-MoreUtils-XS-0.423/inc/Config/AutoConf/LMU.pm --- old/List-MoreUtils-XS-0.421/inc/Config/AutoConf/LMU.pm 2017-08-02 22:10:17.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/inc/Config/AutoConf/LMU.pm 2017-08-18 12:41:12.000000000 +0200 @@ -7,6 +7,65 @@ use base qw(Config::AutoConf); +sub _have_feature_define_name +{ + my $feature = $_[0]; + my $have_name = "HAVE_FEATURE_" . uc($feature); + $have_name =~ tr/ /_/; + $have_name =~ tr/_A-Za-z0-9/_/c; + $have_name; +} + +sub check_statement_expression +{ + my $options = {}; + scalar @_ > 2 and ref $_[-1] eq "HASH" and $options = pop @_; + my ($self, $header) = @_; + $self = $self->_get_instance(); + my $feature = "statement expression"; + + my $cache_name = $self->_cache_name(qw(feature statement expression)); + my $check_sub = sub { + my $prologue = defined $options->{prologue} ? $options->{prologue} : ""; + my $decl = "#define STMT_EXPR ({ 1; })"; + + my $have_stmt_expr = $self->compile_if_else( + $self->lang_build_bool_test($prologue, "STMT_EXPR", $decl), + { + ($options->{action_on_true} ? (action_on_true => $options->{action_on_true}) : ()), + ($options->{action_on_false} ? (action_on_false => $options->{action_on_false}) : ()) + } + ); + + $have_stmt_expr; + }; + + # Run the check and cache the results. + return $self->check_cached( + $cache_name, + "for $feature feature", + $check_sub, + { + action_on_true => sub { + $self->define_var( + _have_feature_define_name($feature), + $self->cache_val($cache_name), + "Defined when feature $feature is available" + ); + $options->{action_on_cache_true} + and ref $options->{action_on_cache_true} eq "CODE" + and $options->{action_on_cache_true}->(); + }, + action_on_false => sub { + $self->define_var(_have_feature_define_name($feature), undef, "Defined when feature $feature is available"); + $options->{action_on_cache_false} + and ref $options->{action_on_cache_false} eq "CODE" + and $options->{action_on_cache_false}->(); + }, + } + ); +} + sub check_lmu_prerequisites { my $self = shift->_get_instance(); @@ -15,7 +74,16 @@ $self->check_all_headers(qw(time.h sys/time.h)); $self->check_funcs([qw(time)]); + unless($self->check_types([qw(size_t ssize_t)])) + { + $self->check_sizeof_types(["int", "long", "long long", "ptr"], { + prologue => $self->_default_includes . <<EOPTR +typedef void * ptr; +EOPTR + }); + } $self->check_builtin("expect"); + $self->check_statement_expression(); } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/lib/List/MoreUtils/XS.pm new/List-MoreUtils-XS-0.423/lib/List/MoreUtils/XS.pm --- old/List-MoreUtils-XS-0.421/lib/List/MoreUtils/XS.pm 2017-08-14 22:17:38.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/lib/List/MoreUtils/XS.pm 2017-08-19 08:55:42.000000000 +0200 @@ -7,7 +7,7 @@ use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS}; -$VERSION = '0.421'; +$VERSION = '0.423'; @EXPORT = (); @EXPORT_OK = qw(any all none notall one @@ -20,7 +20,7 @@ firstidx lastidx onlyidx firstval lastval onlyval firstres lastres onlyres - singleton duplicates frequency occurances mode + singleton duplicates frequency occurrences mode each_array each_arrayref pairwise natatime arrayify mesh zip6 uniq listcmp @@ -66,9 +66,16 @@ my $i = firstidx { $_ eq 'yeah' } @foo; # on sorted - always first, but might not be 'yeah' my $j = lower_bound { $_ cmp 'yeah' } @bar; - # on sorted - any of occurances, is surely 'yeah' + # on sorted - any of occurrences, is surely 'yeah' my $k = bsearchidx { $_ cmp 'yeah' } @bar; +=head1 DESCRIPTION + +List::MoreUtils::XS is a backend for List::MoreUtils. Even if it's possible +(because of user wishes) to have it practically independent from +L<List::MoreUtils>, it technically depend on C<List::MoreUtils>. Since it's +only a backend, the API is not public and can change without any warning. + =head1 SEE ALSO L<List::Util>, L<List::AllUtils> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/inline/binsert.pm new/List-MoreUtils-XS-0.423/t/inline/binsert.pm --- old/List-MoreUtils-XS-0.421/t/inline/binsert.pm 2017-07-28 16:25:26.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/inline/binsert.pm 2017-08-16 08:49:57.000000000 +0200 @@ -2,6 +2,12 @@ use Test::More; use Test::LMU; +SCOPE: { + my @list = (); + is(0, (binsert { $_ cmp "Hello" } "Hello", @list), "Inserting into empty list"); + is(1, (binsert { $_ cmp "world" } "world", @list), "Inserting into one-item list"); +} + my @even = map { $_ * 2 } 1 .. 100; my @odd = map { $_ * 2 - 1 } 1 .. 100; my (@expected, @in); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/inline/bremove.pm new/List-MoreUtils-XS-0.423/t/inline/bremove.pm --- old/List-MoreUtils-XS-0.421/t/inline/bremove.pm 2017-07-28 16:25:26.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/inline/bremove.pm 2017-08-16 08:38:03.000000000 +0200 @@ -36,6 +36,14 @@ } is_deeply(\@in, \@expected, "bremove all even elements reversely succeeded"); +# test from shawnlaffan from GH issue #2 of List-MoreUtils-XS +SCOPE: +{ + my @list = ('somestring'); + my $target = $list[0]; + is ($target, (bremove {$_ cmp $target} @list), 'removed from single item list'); +} + leak_free_ok( 'bremove first' => sub { my @list = (1 .. 100); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/inline/occurances.pm new/List-MoreUtils-XS-0.423/t/inline/occurances.pm --- old/List-MoreUtils-XS-0.421/t/inline/occurances.pm 2017-07-28 19:42:03.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/inline/occurances.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,81 +0,0 @@ - -use Test::More; -use Test::LMU; -use Tie::Array (); - -SCOPE: -{ - my $lorem = - "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."; - my @lorem = grep { $_ } split /(?:\b|\s)/, $lorem; - - my $n_comma = scalar(split /,/, $lorem) - 1; - my $n_dot = scalar(split /\./, $lorem); # there is one at end ... mind the gap - my $n_et = scalar(split /\bet\b/, $lorem) - 1; - - my @l = @lorem; - my @o = occurances @l; - - is(undef, $o[0], "Each word is counted"); - is(undef, $o[1], "Text to long, each word is there at least twice"); - is_deeply([','], $o[$n_comma], "$n_comma comma"); - is_deeply(['.'], $o[$n_dot], "$n_dot dots"); - is_deeply(['et'], $o[$n_et], "$n_et words 'et'"); - - @o = occurances grep { /\w+/ } @lorem; - my $wc = reduce_0 { defined $b ? $a + $_ * scalar @$b : $a } @o; - is( $wc, 124, "Words are as many as requested at www.loremipsum.de" ); -} - -SCOPE: -{ - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my $fp = freeze(\@probes); - my @o = map { ref $_ ? [sort @$_] : $_ } occurances @probes; - is($fp, freeze(\@probes), "probes untouched"); - my @expectation = (undef, undef, [3, 5], [1], [2, 6], undef, undef, [4]); - is_deeply(\@expectation, \@o, "occurances of integer probes"); -} - -SCOPE: -{ - my @probes = ((1) x 3, undef, (2) x 4, undef, (3) x 2, undef, (4) x 7, undef, (5) x 2, undef, (6) x 4); - my $fp = freeze(\@probes); - my @o = map { - ref $_ - ? [sort { (defined $a <=> defined $b) or $a <=> $b } @$_] - : $_ - } occurances @probes; - is($fp, freeze(\@probes), "probes untouched"); - my @expectation = (undef, undef, [3, 5], [1], [2, 6], [undef], undef, [4]); - is_deeply(\@expectation, \@o, "occurances of integer probes"); -} - -leak_free_ok( - occurances => sub { - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my @o = occurances @probes; - }, - 'scalar occurances' => sub { - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my $o = occurances @probes; - } -); - -leak_free_ok( - 'occurances with exception in overloading stringify', - sub { - eval { - my $obj = DieOnStringify->new; - my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); - my @o = occurances @probes; - }; - eval { - my $obj = DieOnStringify->new; - my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); - my $o = occurances @probes; - }; - } -); - -done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/inline/occurrences.pm new/List-MoreUtils-XS-0.423/t/inline/occurrences.pm --- old/List-MoreUtils-XS-0.421/t/inline/occurrences.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/List-MoreUtils-XS-0.423/t/inline/occurrences.pm 2017-08-15 13:31:46.000000000 +0200 @@ -0,0 +1,81 @@ + +use Test::More; +use Test::LMU; +use Tie::Array (); + +SCOPE: +{ + my $lorem = + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."; + my @lorem = grep { $_ } split /(?:\b|\s)/, $lorem; + + my $n_comma = scalar(split /,/, $lorem) - 1; + my $n_dot = scalar(split /\./, $lorem); # there is one at end ... mind the gap + my $n_et = scalar(split /\bet\b/, $lorem) - 1; + + my @l = @lorem; + my @o = occurrences @l; + + is(undef, $o[0], "Each word is counted"); + is(undef, $o[1], "Text to long, each word is there at least twice"); + is_deeply([','], $o[$n_comma], "$n_comma comma"); + is_deeply(['.'], $o[$n_dot], "$n_dot dots"); + is_deeply(['et'], $o[$n_et], "$n_et words 'et'"); + + @o = occurrences grep { /\w+/ } @lorem; + my $wc = reduce_0 { defined $b ? $a + $_ * scalar @$b : $a } @o; + is( $wc, 124, "Words are as many as requested at www.loremipsum.de" ); +} + +SCOPE: +{ + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my $fp = freeze(\@probes); + my @o = map { ref $_ ? [sort @$_] : $_ } occurrences @probes; + is($fp, freeze(\@probes), "probes untouched"); + my @expectation = (undef, undef, [3, 5], [1], [2, 6], undef, undef, [4]); + is_deeply(\@expectation, \@o, "occurrences of integer probes"); +} + +SCOPE: +{ + my @probes = ((1) x 3, undef, (2) x 4, undef, (3) x 2, undef, (4) x 7, undef, (5) x 2, undef, (6) x 4); + my $fp = freeze(\@probes); + my @o = map { + ref $_ + ? [sort { (defined $a <=> defined $b) or $a <=> $b } @$_] + : $_ + } occurrences @probes; + is($fp, freeze(\@probes), "probes untouched"); + my @expectation = (undef, undef, [3, 5], [1], [2, 6], [undef], undef, [4]); + is_deeply(\@expectation, \@o, "occurrences of integer probes"); +} + +leak_free_ok( + occurrences => sub { + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my @o = occurrences @probes; + }, + 'scalar occurrences' => sub { + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my $o = occurrences @probes; + } +); + +leak_free_ok( + 'occurrences with exception in overloading stringify', + sub { + eval { + my $obj = DieOnStringify->new; + my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); + my @o = occurrences @probes; + }; + eval { + my $obj = DieOnStringify->new; + my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); + my $o = occurrences @probes; + }; + } +); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/xs/binsert.t new/List-MoreUtils-XS-0.423/t/xs/binsert.t --- old/List-MoreUtils-XS-0.421/t/xs/binsert.t 2017-08-14 22:17:46.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/xs/binsert.t 2017-08-19 08:56:09.000000000 +0200 @@ -9,6 +9,12 @@ use Test::More; use Test::LMU; +SCOPE: { + my @list = (); + is(0, (binsert { $_ cmp "Hello" } "Hello", @list), "Inserting into empty list"); + is(1, (binsert { $_ cmp "world" } "world", @list), "Inserting into one-item list"); +} + my @even = map { $_ * 2 } 1 .. 100; my @odd = map { $_ * 2 - 1 } 1 .. 100; my (@expected, @in); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/xs/bremove.t new/List-MoreUtils-XS-0.423/t/xs/bremove.t --- old/List-MoreUtils-XS-0.421/t/xs/bremove.t 2017-08-14 22:17:46.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/xs/bremove.t 2017-08-19 08:56:09.000000000 +0200 @@ -43,6 +43,14 @@ } is_deeply(\@in, \@expected, "bremove all even elements reversely succeeded"); +# test from shawnlaffan from GH issue #2 of List-MoreUtils-XS +SCOPE: +{ + my @list = ('somestring'); + my $target = $list[0]; + is ($target, (bremove {$_ cmp $target} @list), 'removed from single item list'); +} + leak_free_ok( 'bremove first' => sub { my @list = (1 .. 100); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/xs/occurances.t new/List-MoreUtils-XS-0.423/t/xs/occurances.t --- old/List-MoreUtils-XS-0.421/t/xs/occurances.t 2017-08-14 22:17:46.000000000 +0200 +++ new/List-MoreUtils-XS-0.423/t/xs/occurances.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,90 +0,0 @@ -#!perl - -use strict ("subs", "vars", "refs"); -use warnings ("all"); -use lib ("t/lib"); -use List::MoreUtils::XS (":all"); - - -use Test::More; -use Test::LMU; -use Tie::Array (); - -SCOPE: -{ - my $lorem = - "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."; - my @lorem = grep { $_ } split /(?:\b|\s)/, $lorem; - - my $n_comma = scalar(split /,/, $lorem) - 1; - my $n_dot = scalar(split /\./, $lorem); # there is one at end ... mind the gap - my $n_et = scalar(split /\bet\b/, $lorem) - 1; - - my @l = @lorem; - my @o = occurances @l; - - is(undef, $o[0], "Each word is counted"); - is(undef, $o[1], "Text to long, each word is there at least twice"); - is_deeply([','], $o[$n_comma], "$n_comma comma"); - is_deeply(['.'], $o[$n_dot], "$n_dot dots"); - is_deeply(['et'], $o[$n_et], "$n_et words 'et'"); - - @o = occurances grep { /\w+/ } @lorem; - my $wc = reduce_0 { defined $b ? $a + $_ * scalar @$b : $a } @o; - is( $wc, 124, "Words are as many as requested at www.loremipsum.de" ); -} - -SCOPE: -{ - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my $fp = freeze(\@probes); - my @o = map { ref $_ ? [sort @$_] : $_ } occurances @probes; - is($fp, freeze(\@probes), "probes untouched"); - my @expectation = (undef, undef, [3, 5], [1], [2, 6], undef, undef, [4]); - is_deeply(\@expectation, \@o, "occurances of integer probes"); -} - -SCOPE: -{ - my @probes = ((1) x 3, undef, (2) x 4, undef, (3) x 2, undef, (4) x 7, undef, (5) x 2, undef, (6) x 4); - my $fp = freeze(\@probes); - my @o = map { - ref $_ - ? [sort { (defined $a <=> defined $b) or $a <=> $b } @$_] - : $_ - } occurances @probes; - is($fp, freeze(\@probes), "probes untouched"); - my @expectation = (undef, undef, [3, 5], [1], [2, 6], [undef], undef, [4]); - is_deeply(\@expectation, \@o, "occurances of integer probes"); -} - -leak_free_ok( - occurances => sub { - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my @o = occurances @probes; - }, - 'scalar occurances' => sub { - my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); - my $o = occurances @probes; - } -); - -leak_free_ok( - 'occurances with exception in overloading stringify', - sub { - eval { - my $obj = DieOnStringify->new; - my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); - my @o = occurances @probes; - }; - eval { - my $obj = DieOnStringify->new; - my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); - my $o = occurances @probes; - }; - } -); - -done_testing; - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/List-MoreUtils-XS-0.421/t/xs/occurrences.t new/List-MoreUtils-XS-0.423/t/xs/occurrences.t --- old/List-MoreUtils-XS-0.421/t/xs/occurrences.t 1970-01-01 01:00:00.000000000 +0100 +++ new/List-MoreUtils-XS-0.423/t/xs/occurrences.t 2017-08-19 08:56:09.000000000 +0200 @@ -0,0 +1,90 @@ +#!perl + +use strict ("subs", "vars", "refs"); +use warnings ("all"); +use lib ("t/lib"); +use List::MoreUtils::XS (":all"); + + +use Test::More; +use Test::LMU; +use Tie::Array (); + +SCOPE: +{ + my $lorem = + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."; + my @lorem = grep { $_ } split /(?:\b|\s)/, $lorem; + + my $n_comma = scalar(split /,/, $lorem) - 1; + my $n_dot = scalar(split /\./, $lorem); # there is one at end ... mind the gap + my $n_et = scalar(split /\bet\b/, $lorem) - 1; + + my @l = @lorem; + my @o = occurrences @l; + + is(undef, $o[0], "Each word is counted"); + is(undef, $o[1], "Text to long, each word is there at least twice"); + is_deeply([','], $o[$n_comma], "$n_comma comma"); + is_deeply(['.'], $o[$n_dot], "$n_dot dots"); + is_deeply(['et'], $o[$n_et], "$n_et words 'et'"); + + @o = occurrences grep { /\w+/ } @lorem; + my $wc = reduce_0 { defined $b ? $a + $_ * scalar @$b : $a } @o; + is( $wc, 124, "Words are as many as requested at www.loremipsum.de" ); +} + +SCOPE: +{ + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my $fp = freeze(\@probes); + my @o = map { ref $_ ? [sort @$_] : $_ } occurrences @probes; + is($fp, freeze(\@probes), "probes untouched"); + my @expectation = (undef, undef, [3, 5], [1], [2, 6], undef, undef, [4]); + is_deeply(\@expectation, \@o, "occurrences of integer probes"); +} + +SCOPE: +{ + my @probes = ((1) x 3, undef, (2) x 4, undef, (3) x 2, undef, (4) x 7, undef, (5) x 2, undef, (6) x 4); + my $fp = freeze(\@probes); + my @o = map { + ref $_ + ? [sort { (defined $a <=> defined $b) or $a <=> $b } @$_] + : $_ + } occurrences @probes; + is($fp, freeze(\@probes), "probes untouched"); + my @expectation = (undef, undef, [3, 5], [1], [2, 6], [undef], undef, [4]); + is_deeply(\@expectation, \@o, "occurrences of integer probes"); +} + +leak_free_ok( + occurrences => sub { + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my @o = occurrences @probes; + }, + 'scalar occurrences' => sub { + my @probes = ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4); + my $o = occurrences @probes; + } +); + +leak_free_ok( + 'occurrences with exception in overloading stringify', + sub { + eval { + my $obj = DieOnStringify->new; + my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); + my @o = occurrences @probes; + }; + eval { + my $obj = DieOnStringify->new; + my @probes = ((1) x 3, $obj, (2) x 4, $obj, (3) x 2, $obj, (4) x 7, $obj, (5) x 2, $obj, (6) x 4); + my $o = occurrences @probes; + }; + } +); + +done_testing; + + ++++++ cpanspec.yml ++++++ --- /var/tmp/diff_new_pack.ROevrO/_old 2017-09-13 21:36:24.706895223 +0200 +++ /var/tmp/diff_new_pack.ROevrO/_new 2017-09-13 21:36:24.706895223 +0200 @@ -10,6 +10,8 @@ #patches: # foo.patch: -p1 # bar.patch: +format.patch: -p1 +undefined.patch: -p1 #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- ++++++ format.patch ++++++ Index: List-MoreUtils-XS-0.423/XS.xs =================================================================== --- List-MoreUtils-XS-0.423.orig/XS.xs +++ List-MoreUtils-XS-0.423/XS.xs @@ -2310,7 +2310,7 @@ CODE: idx = SvIV(*PL_stack_sp); if (UNLIKELY(idx < 0 && (idx += (AvFILLp(tmp)+1)) < 0)) - croak("Modification of non-creatable array value attempted, subscript %ld", idx); + croak("Modification of non-creatable array value attempted, subscript %" IVdf, idx); if(UNLIKELY(NULL == (inner = av_fetch(tmp, idx, FALSE)))) { ++++++ undefined.patch ++++++ Index: List-MoreUtils-XS-0.423/XS.xs =================================================================== --- List-MoreUtils-XS-0.423.orig/XS.xs +++ List-MoreUtils-XS-0.423/XS.xs @@ -2114,7 +2114,8 @@ CODE: if(seen_undef == max) { - EXTEND(SP, ++count); + ++count; + EXTEND(SP, count); ST(count-1) = &PL_sv_undef; }