Skip Menu |

This queue is for tickets about the Algorithm-Merge CPAN distribution.

Report information
The Basics
Id: 4054
Status: resolved
Worked: 5 min
Priority: 0/
Queue: Algorithm-Merge

People
Owner: cpan [...] jamesmith.com
Requestors: chris [...] clotho.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: Failute to detect a difference
The following example program produces this bad output: % ./test.pl u 0 0 0 u 1 1 1 u 2 2 2 u 3 3 3 u 4 4 4 u 5 x 5 u 6 5 6 u 7 6 7 u 8 7 8 u 9 8 9 l - 9 - ------------ test.pl ------------ #!/usr/bin/perl -w use strict; use Algorithm::Merge; my @a = 0..9; my @b = (@a); my @c = (@a); # add a new one to @b to make it different splice @b, 5, 0, "x"; my @diff = Algorithm::Merge::diff3(\@a, \@b, \@c); for (@diff) { map { $_ = "-" if (!defined $_) } @$_; # convert undef -> "-" print "@$_\n"; } ---------------------------------
Subject: Failure to detect a difference
Oops. sorry. More details: perl: 5.8.1 os: darwin (mac osx 10.2) A::M v0.03 A::D v1.15
Subject: Failure to detect a difference
From: chris [...] clotho.com
Attached is a patch to t/20diff.t that reproduces the bug detailed in the previous comment. Very oddly, putting a similar patch (like the following) in 10merge.t does NOT reproduce the bug. push @tests, [ [qw(0 1 2 3 4 5 6 7 8 9)], [qw(0 1 2 3 4 5 10 6 7 8 9)], [qw(0 1 2 3 4 5 6 7 8 9)], [qw(0 1 2 3 4 5 10 6 7 8 9)], ];
diff -ur Algorithm-Merge-0.03/t/20diff.t Algorithm-Merge-0.03-new/t/20diff.t --- Algorithm-Merge-0.03/t/20diff.t 2003-04-22 13:21:07.000000000 -0500 +++ Algorithm-Merge-0.03-new/t/20diff.t 2003-10-09 09:11:50.000000000 -0500 @@ -57,6 +57,26 @@ } } +push @tests, [ + [qw(0 1 2 3 4 5 6 7 8 9)], + [qw(0 1 2 3 4 5 10 6 7 8 9)], + [qw(0 1 2 3 4 5 6 7 8 9)], + [ + ['u', 0, 0, 0], + ['u', 1, 1, 1], + ['u', 2, 2, 2], + ['u', 3, 3, 3], + ['u', 4, 4, 4], + ['u', 5, 5, 5], + ['l', undef, 10, undef], + ['u', 6, 6, 6], + ['u', 7, 7, 7], + ['u', 8, 8, 8], + ['u', 9, 9, 9], + ], +]; + + plan tests => scalar(@tests); my $out;
It appears that this is at least fixed in the most recent version (0.04) uploaded to CPAN. Tested both merge() and diff3().
Subject: Failure to detect a difference
From: chris [...] clotho.com
[JSMITH - Wed Oct 29 01:00:31 2003]: Show quoted text
> It appears that this is at least fixed in the most recent version (0.04) > uploaded to CPAN. Tested both merge() and diff3().
I confirm that it's fixed. Thanks! -- Chris