Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Saturday August 02, 2008
07:11 AM

Test::Differences Now Supports Alternate Diff Styles

[ #37083 ]

The new Test::Differences, 0.49_02 should be on the CPAN soon. It now supports all of the diff styles available in Text::Diff. This eliminates all of the remaining RT tickets in the queue.

use Test::More 'no_plan';
use Test::Differences;

my $long_string = join '' => 1..40;

    local $TODO = 'Testing diff styles';

    # this is the default and does not need to explicitly set unless you need
    # to reset it back from another diff type
    eq_or_diff $long_string, "-$long_string", 'table diff';

    eq_or_diff $long_string, "-$long_string", 'unified diff';

    eq_or_diff $long_string, "-$long_string", 'context diff';

    eq_or_diff $long_string, "-$long_string", 'oldstyle diff';

I don't particularly care for the other diff styles, but when you have a 60 character string forcing the table to wrap, they can come in handy.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.