5 use Test
::More tests
=> 9;
6 BEGIN { use_ok
('Text::Levenshtein::Edlib', ':all') };
10 foreach my $constname (qw(
11 EDLIB_CIGAR_EXTENDED EDLIB_CIGAR_STANDARD EDLIB_EDOP_DELETE
12 EDLIB_EDOP_INSERT EDLIB_EDOP_MATCH EDLIB_EDOP_MISMATCH EDLIB_MODE_HW
13 EDLIB_MODE_NW EDLIB_MODE_SHW EDLIB_STATUS_ERROR EDLIB_STATUS_OK
14 EDLIB_TASK_DISTANCE EDLIB_TASK_LOC EDLIB_TASK_PATH)) {
15 next if (eval "my \$a = $constname; 1");
16 if ($@
=~ /^Your vendor has not defined Text::Levenshtein::Edlib macro $constname/) {
25 ok
( $fail == 0 , 'Constants' );
27 my $r = distance
'kitten', 'sitting';
29 $r = distance
'kitten', 'sitting', 2;
30 ok
!defined $r, 'distance w/ max_distance';
32 $r = align
'kitten', 'sitting';
33 is
$r->{editDistance
}, 3, 'align->{editDistance}';
34 is
$r->{alphabetLength
}, 7, 'align->{alphabetLength}';
36 is_deeply
$r->{endLocations
}, [6], 'align->{endLocations}';
37 is_deeply
$r->{startLocations
}, [0], 'align->{startLocations}';
38 is_deeply
$r->{alignment
}, [3, 0, 0, 0, 3, 0, 2], 'align->{alignment}';
This page took 0.024463 seconds and 4 git commands to generate.