Skip Menu |

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

Report information
The Basics
Id: 58031
Status: new
Priority: 0/
Queue: Algorithm-Merge

People
Owner: Nobody in particular
Requestors: bobh528 [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.08
Fixed in: (no value)



Attached please find short program trying to use diff3 from Algorithm::Merge with a small dataset. Here is the output I get: Algorithm::Diff version: 1.1902 Algorithm::Merge version: 0.08 @o = ( A C F G H ) @l = ( A C E F G H ) @r = ( A B C D E F G H ) 1 u A A A 2 r undef undef B 3 u C C C 4 u F E D 5 u G F E 6 u H G F 7 u undef undef A 8 r undef undef H Until row 4 things look OK, but row 4 and beyond look wrong. I would have expected result more like: 1 u A A A 2 r undef undef B 3 u C C C 4 r undef undef D 5 l undef E E 6 u F F F 7 u G G G 8 u H H H (note especially row 7 that includes 'A' in the last col rather than 'G'. Can't imagine what's going on with that) perl -v output: This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com Built Sep 3 2008 13:16:37 Thoughts? Am I misunderstanding what diff3 is supposed to do?
Subject: TestMerge.pl
use strict; use Algorithm::Diff; use Algorithm::Merge qw( diff3 ); print "Algorithm::Diff version: $Algorithm::Diff::VERSION\n"; print "Algorithm::Merge version: $Algorithm::Merge::VERSION\n"; my (@o, @l, @r); # initialize original, left, and right arrays: @o = qw( A C F G H); @l = qw( A C E F G H); @r = qw( A B C D E F G H); # For reference, print contents of original, left, and right arrays: print "\@o = ( ", join(' ', @o), " )\n"; print "\@l = ( ", join(' ', @l), " )\n"; print "\@r = ( ", join(' ', @r), " )\n"; # Execute diff3 my @diff = diff3(\@o, \@l, \@r); # Print results my $i; foreach my $d (@diff) { print ++$i, " $d->[0] "; map {printf "%-8s", defined($d->[$_]) ? $d->[$_] : "undef"} (1..3); print "\n"; } exit;