String-DiffLine

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN

# of the test code):

my @tests=(
           [2 ,sub{},        ["abcdef"       ,"abcxyz"      ],[3,1,3],    ],
           [3 ,sub{},        ["abcdef"       ,"abc"         ],[3,1,3],	  ],
           [4 ,sub{},        ["abc"          ,"abc"         ],[undef,1,3],],
           [5 ,sub{},        ["abc\ndefg"    ,"abc\ndxy"    ],[5,2,1],	  ],
           [6 ,sub{},        ["abc\n\ndefg"  ,"abc\n\ndxy"  ],[6,3,1],	  ],
           [7 ,sub{},        ["abc\ndef\n"   ,"abc\ndef\n"  ],[undef,3,0],],
           [8 ,sub{$/="x"},  ["abcxdefg"     ,"abcxdefy"    ],[7,2,3],	  ],
           [9 ,sub{$/=""} ,  ["abc\n\n\ndefg","abc\n\n\nxy" ],[6,2,0],	  ],
           [10,sub{$/="121"},["1212121def"   ,"1212121dex"  ],[9,3,2],	  ],
           [11,sub{$/="112"},["11121112de"   ,"11121112df"  ],[9,3,1],    ],
           [12,sub{$/="112"},["112112x"      ,"112112ab"    ],[6,3,0],    ],
          );

foreach my $test (@tests)
{
  my($n,$s,$in,$tout)=@$test;
  &$s;
  my(@in2)=@$in; 



( run in 0.400 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )