LasTres/t/02-words.t

32 lines
639 B
Perl

#!/usr/bin/env perl
use v5.36.0;
use strict;
use warnings;
use feature 'signatures';
use Scalar::Util qw/blessed/;
use Test::Most qw/bail no_plan/;
{
use_ok 'LasTres::Words';
}
{
my $words_factory = LasTres::Words->new;
my $words = $words_factory->hash;
for my $identifier (keys %$words) {
my $word = $words->{$identifier};
test_word($word);
}
}
sub test_word($word) {
ok $word->does('LasTres::Word'), (blessed $word)
. ' implements LasTres::Word.';
ok defined $word->name, (blessed $word) . ' has name.';
ok defined $word->identifier, (blessed $word) . ' has identifier.';
}