Algorithm-Diff
view release on metacpan or search on metacpan
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl base.t'
use strict;
$^W++;
use lib qw(blib lib);
use Algorithm::Diff qw(diff LCS traverse_sequences traverse_balanced sdiff);
use Data::Dumper;
use Test;
BEGIN
{
$|++;
plan tests => 35;
$SIG{__DIE__} = sub # breakpoint on die
{
$DB::single = 1;
$DB::single = 1; # avoid complaint
ok( "@discardsA", $skippedA);
ok( "@discardsB", $skippedB);
ok( $finishedA, 9, "index of finishedA" );
ok( $finishedB, undef, "index of finishedB" );
my @lcs = LCS( \@a, \@b );
ok( "@lcs", $correctResult );
# Compare the diff output with the one from the Algorithm::Diff manpage.
my $diff = diff( \@a, \@b );
$Data::Dumper::Indent = 0;
my $cds = Dumper($correctDiffResult);
my $dds = Dumper($diff);
ok( $dds, $cds );
##################################################
# <Mike Schilli> m@perlmeister.com 03/23/2002:
# Tests for sdiff-interface
#################################################
@a = qw(abc def yyy xxx ghi jkl);
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl oo.t'
use strict;
BEGIN { $^W++; }
use lib qw( blib lib );
use Algorithm::Diff qw( compact_diff );
use Data::Dumper;
use Test qw( plan ok $ntest );
BEGIN
{
$|++;
plan( tests => 969 );
$SIG{__DIE__} = sub # breakpoint on die
{
$DB::single = 1
if ! $^S;
( run in 0.945 second using v1.01-cache-2.11-cpan-a5abf4f5562 )