Run of fresh-snapshots for libtest-longstring-perl

Merge these changes:

Summary

Merged new upstream version: 0.17+git20150527.1.c162a6a (was: 0.17).

Diff

Branch: main

diff --git a/META.json b/META.json
index eeaf131..a4ef7b2 100644
--- a/META.json
+++ b/META.json
@@ -4,13 +4,13 @@
       "Rafael Garcia-Suarez <rgs@consttype.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.120921",
+   "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010",
    "license" : [
       "perl_5"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Test-LongString",
    "no_index" : {
@@ -45,5 +45,6 @@
          "web" : "https://github.com/rgs/Test-LongString"
       }
    },
-   "version" : "0.17"
+   "version" : "0.17",
+   "x_serialization_backend" : "JSON::PP version 4.06"
 }
diff --git a/META.yml b/META.yml
index f5ebf82..00d1ab3 100644
--- a/META.yml
+++ b/META.yml
@@ -3,23 +3,24 @@ abstract: unknown
 author:
   - 'Rafael Garcia-Suarez <rgs@consttype.org>'
 build_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 configure_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+  version: '1.4'
 name: Test-LongString
 no_index:
   directory:
     - t
     - inc
 requires:
-  Test::Builder: 0.12
-  Test::Builder::Tester: 1.04
+  Test::Builder: '0.12'
+  Test::Builder::Tester: '1.04'
 resources:
   repository: https://github.com/rgs/Test-LongString.git
-version: 0.17
+version: '0.17'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/debian/changelog b/debian/changelog
index 947e998..ae38965 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libtest-longstring-perl (0.17-2) UNRELEASED; urgency=medium
+libtest-longstring-perl (0.17+git20150527.1.c162a6a-1) UNRELEASED; urgency=medium
 
   [ Salvatore Bonaccorso ]
   * debian/control: Use HTTPS transport protocol for Vcs-Git URI
@@ -16,7 +16,10 @@ libtest-longstring-perl (0.17-2) UNRELEASED; urgency=medium
   [ gregor herrmann ]
   * debian/watch: use uscan version 4.
 
- -- Salvatore Bonaccorso <carnil@debian.org>  Sat, 30 Jan 2016 20:06:53 +0100
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Salvatore Bonaccorso <carnil@debian.org>  Fri, 25 Mar 2022 12:37:51 -0000
 
 libtest-longstring-perl (0.17-1.1) unstable; urgency=medium
 
diff --git a/lib/Test/LongString.pm b/lib/Test/LongString.pm
index 95f41f2..d5f0cf6 100644
--- a/lib/Test/LongString.pm
+++ b/lib/Test/LongString.pm
@@ -6,7 +6,6 @@ use vars qw($VERSION @ISA @EXPORT $Max $Context $EOL $LCSS);
 $VERSION = '0.17';
 
 use Test::Builder;
-my $Tester = new Test::Builder();
 
 use Exporter;
 @ISA    = ('Exporter');
@@ -36,7 +35,7 @@ sub import {
 
 # _display($string, [$offset = 0])
 # Formats a string for display. Begins at $offset minus $Context.
-# This function ought to be configurable, � la od(1).
+# This function ought to be configurable, à la od(1).
 
 sub _display {
     my $s = shift;
@@ -70,6 +69,7 @@ sub _common_prefix_length {
 sub contains_string($$;$) {
     my ($str,$sub,$name) = @_;
 
+    my $Tester = new Test::Builder();
     my $ok;
     if (!defined $str) {
         $Tester->ok($ok = 0, $name);
@@ -118,28 +118,27 @@ DIAG
 sub _lcss($$) {
     my ($S, $T) = (@_);
     my @L;
-    my ($offset, $length) = (0,0);
+    my ($offset, $length, $swapped, $length_S, $length_T, $flipper, $eq_flag, $less_j) = (0,0,0);
 
     # prevent us from having to zero a $ix$j matrix
     no warnings 'uninitialized';
 
+    $length_S = length($S);
+    $length_T = length($T);
+    ($T, $S, $length_T, $length_S, $swapped, $less_j) = ($S, $T, $length_S, $length_T, 1, $length_T) if $length_T > $length_S;
     # now the actual LCSS algorithm
-    foreach my $i (0 .. length($S) ) {
-        foreach my $j (0 .. length($T)) {
-            if (substr($S, $i, 1) eq substr($T, $j, 1)) {
-                if ($i == 0 or $j == 0) {
-                    $L[$i][$j] = 1;
-                }
-                else {
-                    $L[$i][$j] = $L[$i-1][$j-1] + 1;
-                }
-                if ($L[$i][$j] > $length) {
-                    $length = $L[$i][$j];
-                    $offset = $i - $length + 1;
-                }
-            }
-        }
-    }
+    foreach my $i (1 .. $length_S ) { 
+        $flipper = $i&1;
+        foreach my $j (1 .. $length_T) {
+            $eq_flag = substr($S, $i-1, 1) eq substr($T, $j-1, 1) ? 1 : 0;
+            $L[$flipper][$j] = $L[$flipper^1][$j-1] + $eq_flag;
+            if ($eq_flag && ($L[$flipper][$j] > $length || ($swapped && $L[$flipper][$j] >= $length && $less_j > $j))) {
+                $length = $L[$flipper][$j];
+                $offset = ( $swapped ? $j : $i ) - $length;
+                $less_j = $j; 
+            }   
+        }   
+    }   
 
     # if you want to display just the lcss:
     # return substr($S, $offset, $length);
@@ -152,6 +151,7 @@ sub _lcss($$) {
 sub lacks_string($$;$) {
     my ($str,$sub,$name) = @_;
 
+    my $Tester = new Test::Builder();
     my $ok;
     if (!defined $str) {
         $Tester->ok($ok = 0, $name);
@@ -180,6 +180,7 @@ DIAG
 
 sub is_string ($$;$) {
     my ($got, $expected, $name) = @_;
+    my $Tester = new Test::Builder();
     if (!defined $got || !defined $expected) {
 	my $ok = !defined $got && !defined $expected;
 	$Tester->ok($ok, $name);
@@ -219,6 +220,7 @@ DIAG
 
 sub is_string_nows ($$;$) {
     my ($got, $expected, $name) = @_;
+    my $Tester = new Test::Builder();
     if (!defined $got || !defined $expected) {
 	my $ok = !defined $got && !defined $expected;
 	$Tester->ok($ok, $name);
@@ -267,6 +269,7 @@ sub unlike_string ($$;$) {
 sub _like {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     my ($got, $regex, $cmp, $name) = @_;
+    my $Tester = new Test::Builder();
     my $ok = 0;
     my $usable_regex = $Tester->maybe_regex($regex);
     unless (defined $usable_regex) {

Branch: pristine-tar

diff --git a/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.delta b/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.delta
new file mode 100644
index 0000000..d4c419d
Binary files /dev/null and b/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.delta differ
diff --git a/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.id b/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.id
new file mode 100644
index 0000000..051c2ce
--- /dev/null
+++ b/libtest-longstring-perl_0.17+git20150527.1.c162a6a.orig.tar.gz.id
@@ -0,0 +1 @@
+a416bfc0d050890f43d9f252e8aa51835e4c9206

Branch: upstream

Tag: upstream/0.17+git20150527.1.c162a6a
diff --git a/META.json b/META.json
index eeaf131..a4ef7b2 100644
--- a/META.json
+++ b/META.json
@@ -4,13 +4,13 @@
       "Rafael Garcia-Suarez <rgs@consttype.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.120921",
+   "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010",
    "license" : [
       "perl_5"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Test-LongString",
    "no_index" : {
@@ -45,5 +45,6 @@
          "web" : "https://github.com/rgs/Test-LongString"
       }
    },
-   "version" : "0.17"
+   "version" : "0.17",
+   "x_serialization_backend" : "JSON::PP version 4.06"
 }
diff --git a/META.yml b/META.yml
index f5ebf82..00d1ab3 100644
--- a/META.yml
+++ b/META.yml
@@ -3,23 +3,24 @@ abstract: unknown
 author:
   - 'Rafael Garcia-Suarez <rgs@consttype.org>'
 build_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 configure_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+  version: '1.4'
 name: Test-LongString
 no_index:
   directory:
     - t
     - inc
 requires:
-  Test::Builder: 0.12
-  Test::Builder::Tester: 1.04
+  Test::Builder: '0.12'
+  Test::Builder::Tester: '1.04'
 resources:
   repository: https://github.com/rgs/Test-LongString.git
-version: 0.17
+version: '0.17'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/lib/Test/LongString.pm b/lib/Test/LongString.pm
index 95f41f2..d5f0cf6 100644
--- a/lib/Test/LongString.pm
+++ b/lib/Test/LongString.pm
@@ -6,7 +6,6 @@ use vars qw($VERSION @ISA @EXPORT $Max $Context $EOL $LCSS);
 $VERSION = '0.17';
 
 use Test::Builder;
-my $Tester = new Test::Builder();
 
 use Exporter;
 @ISA    = ('Exporter');
@@ -36,7 +35,7 @@ sub import {
 
 # _display($string, [$offset = 0])
 # Formats a string for display. Begins at $offset minus $Context.
-# This function ought to be configurable, � la od(1).
+# This function ought to be configurable, à la od(1).
 
 sub _display {
     my $s = shift;
@@ -70,6 +69,7 @@ sub _common_prefix_length {
 sub contains_string($$;$) {
     my ($str,$sub,$name) = @_;
 
+    my $Tester = new Test::Builder();
     my $ok;
     if (!defined $str) {
         $Tester->ok($ok = 0, $name);
@@ -118,28 +118,27 @@ DIAG
 sub _lcss($$) {
     my ($S, $T) = (@_);
     my @L;
-    my ($offset, $length) = (0,0);
+    my ($offset, $length, $swapped, $length_S, $length_T, $flipper, $eq_flag, $less_j) = (0,0,0);
 
     # prevent us from having to zero a $ix$j matrix
     no warnings 'uninitialized';
 
+    $length_S = length($S);
+    $length_T = length($T);
+    ($T, $S, $length_T, $length_S, $swapped, $less_j) = ($S, $T, $length_S, $length_T, 1, $length_T) if $length_T > $length_S;
     # now the actual LCSS algorithm
-    foreach my $i (0 .. length($S) ) {
-        foreach my $j (0 .. length($T)) {
-            if (substr($S, $i, 1) eq substr($T, $j, 1)) {
-                if ($i == 0 or $j == 0) {
-                    $L[$i][$j] = 1;
-                }
-                else {
-                    $L[$i][$j] = $L[$i-1][$j-1] + 1;
-                }
-                if ($L[$i][$j] > $length) {
-                    $length = $L[$i][$j];
-                    $offset = $i - $length + 1;
-                }
-            }
-        }
-    }
+    foreach my $i (1 .. $length_S ) { 
+        $flipper = $i&1;
+        foreach my $j (1 .. $length_T) {
+            $eq_flag = substr($S, $i-1, 1) eq substr($T, $j-1, 1) ? 1 : 0;
+            $L[$flipper][$j] = $L[$flipper^1][$j-1] + $eq_flag;
+            if ($eq_flag && ($L[$flipper][$j] > $length || ($swapped && $L[$flipper][$j] >= $length && $less_j > $j))) {
+                $length = $L[$flipper][$j];
+                $offset = ( $swapped ? $j : $i ) - $length;
+                $less_j = $j; 
+            }   
+        }   
+    }   
 
     # if you want to display just the lcss:
     # return substr($S, $offset, $length);
@@ -152,6 +151,7 @@ sub _lcss($$) {
 sub lacks_string($$;$) {
     my ($str,$sub,$name) = @_;
 
+    my $Tester = new Test::Builder();
     my $ok;
     if (!defined $str) {
         $Tester->ok($ok = 0, $name);
@@ -180,6 +180,7 @@ DIAG
 
 sub is_string ($$;$) {
     my ($got, $expected, $name) = @_;
+    my $Tester = new Test::Builder();
     if (!defined $got || !defined $expected) {
 	my $ok = !defined $got && !defined $expected;
 	$Tester->ok($ok, $name);
@@ -219,6 +220,7 @@ DIAG
 
 sub is_string_nows ($$;$) {
     my ($got, $expected, $name) = @_;
+    my $Tester = new Test::Builder();
     if (!defined $got || !defined $expected) {
 	my $ok = !defined $got && !defined $expected;
 	$Tester->ok($ok, $name);
@@ -267,6 +269,7 @@ sub unlike_string ($$;$) {
 sub _like {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     my ($got, $regex, $cmp, $name) = @_;
+    my $Tester = new Test::Builder();
     my $ok = 0;
     my $usable_regex = $Tester->maybe_regex($regex);
     unless (defined $usable_regex) {

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☒ command changed from DEB_UPDATE_CHANGELOG=update deb-new-upstream --snapshot --refresh-patches to DEB_UPDATE_CHANGELOG=auto deb-new-upstream --snapshot --refresh-patches
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far. not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 1135, max open: 200)
  • ☑ change set 436e87b3-1fcb-4fa7-aa91-4acdbd32b826 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots libtest-longstring-perl

Lintian Result

Full worker log Full build log