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";
}
---------------------------------