summaryrefslogtreecommitdiffstats
path: root/t/003-array-wordlist.t
blob: 148f76195586a0814d8222bd6404e073f4975e1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!perl -T
use strict;
use warnings;
use Test::More tests => 4;
use Test::Exception;
use Games::Word::Wordlist;

my @words = qw/foo bar baz/;
my $wl;
lives_ok { $wl = Games::Word::Wordlist->new(\@words) }
         "creating a wordlist from an array succeeds";
is($wl->words, 3, "created the correct number of words in the word list");
$wl->add_words(['zab', 'rab', 'oof', 'foo']);
is($wl->words, 6, "adding words results in the correct number of words");
$wl->remove_words(qw/rab foo quux/);
is($wl->words, 4, "deleting words results in the correct number of words");