File: 01-original.t

package info (click to toggle)
libtext-levenshtein-perl 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 148 kB
  • ctags: 6
  • sloc: perl: 460; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl
#
# 01-original.t - this is the original testsuite that was included
#

use 5.006;
use strict;
use warnings;

use Test::More 0.88 tests => 9;

use Text::Levenshtein qw(distance fastdistance);

is_deeply(distance("foo","four"),2,"Correct distance foo four");
is_deeply(distance("foo","foo"),0,"Correct distance foo foo");
is_deeply(distance("cow","cat"),2,"Correct distance cow cat");
is_deeply(distance("cat","moocow"),5,"Correct distance cat moocow");
is_deeply(distance("cat","cowmoo"),5,"Correct distance cat cowmoo");
is_deeply(distance("sebastian","sebastien"),1,"Correct distance sebastian sebastien");
is_deeply(distance("more","cowbell"),5,"Correct distance more cowbell");
my @foo = distance("foo","four","foo","bar");
my @bar = (2,0,3);
is_deeply(\@foo,\@bar,"Array test: Correct distances foo four foo bar");
is_deeply(fastdistance("foo","boo"),1,"Fast test: Correct distance foo boo");