Archive-Ipkg
view release on metacpan or search on metacpan
t/3_strict_properties.t view on Meta::CPAN
use Test::More tests => 50;
use Archive::Ipkg;
# test strictness of properties
my $ipkg = Archive::Ipkg->new();
# name =~ [a-z0-9.+-]+
ok(!defined $ipkg->name("Uppercase_Is_Evil"));
ok(!defined $ipkg->name("underscore_not_allowed"));
ok(!defined $ipkg->name("symbols#also'bad"));
ok(!defined $ipkg->name("ümläut-vérbötèn"));
ok(!defined $ipkg->name("spaces. urgs."));
# version =~ [a-zA-Z0-9.+]* , with at least one digit
# initially, version is '', but if you set an invalid one, it will be
# set to undef to warn you something went wrong
ok(!defined $ipkg->version("nodigits_is_not_nice"));
ok(!defined $ipkg->name("symbols#also'bad"));
ok(!defined $ipkg->name("ümläut-vérbötèn"));
ok(!defined $ipkg->name("spaces. urgs."));
# section; 21 tests
ok(!defined $ipkg->section("weird_weird"));
@cat_familiar = qw(admin base comm editors extras graphics libs misc net text web x11);
@cat_opie = qw(Games Multimedia Communications Settings Utilities Applications Console Misc);
foreach (@cat_familiar, @cat_opie) {
ok($ipkg->section($_) eq $_);
( run in 0.260 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )