File: 07-add-dictionary.t

package info (click to toggle)
libtext-hunspell-perl 2.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,052 kB
  • sloc: perl: 99; makefile: 8
file content (26 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;

use Data::Dumper;
use Test::More tests => 4;
use Text::Hunspell;

my $speller = Text::Hunspell->new(qw(./t/test.aff ./t/test.dic));
die unless $speller;
ok($speller, qq(Created a Text::Hunspell object [$speller]));

my $word = q(munkey);
ok(
    !$speller->check($word),
    qq(Word '$word' shouldn't be in the test dictionary)
);

ok(
    !$speller->add_dic(q(./t/supp.dic)),
    q(Added a supplemental dictionary)
);

ok(
    $speller->check($word),
    qq(Word '$word' is in the supplemental dictionary)
);