#!/usr/bin/perl
-# This is automatically generated by author/import-moose-test.pl.
-# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
-use t::lib::MooseCompat;
use strict;
use warnings;
-use Test::More;
-$TODO = q{Mouse is not yet completed};
+use Test::More tests => 28;
use Test::Exception;
BEGIN {
use_ok("Mouse::Util::TypeConstraints");
- use_ok('Mouse::Meta::TypeConstraint');
+ use_ok('Mouse::Meta::TypeConstraint::Parameterized');
}
lives_ok {
ok( $hoi->equals($hoi), "equals to self" );
ok( !$hoi->equals($hoi->parent), "equals to self" );
ok( !$hoi->equals(find_type_constraint('AlphaKeyHash')), "not equal to unparametrized self" );
-ok( $hoi->equals( Mouse::Meta::TypeConstraint->new( name => "Blah", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Int") ) ), "equal to clone" );
-ok( !$hoi->equals( Mouse::Meta::TypeConstraint->new( name => "Oink", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Str") ) ), "not equal to different parameter" );
+ok( $hoi->equals( Mouse::Meta::TypeConstraint::Parameterized->new( name => "Blah", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Int") ) ), "equal to clone" );
+ok( !$hoi->equals( Mouse::Meta::TypeConstraint::Parameterized->new( name => "Oink", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Str") ) ), "not equal to different parameter" );
my $th = Mouse::Util::TypeConstraints::find_or_parse_type_constraint('Trihash[Bool]');
ok(!$th->check({foo1 => 1, bar2 => 0, baz3 => 1}), '... validated it correctly');
dies_ok {
- Mouse::Meta::TypeConstraint->new(
+ Mouse::Meta::TypeConstraint::Parameterized->new(
name => 'Str[Int]',
parent => find_type_constraint('Str'),
type_parameter => find_type_constraint('Int'),
} 'non-containers cannot be parameterized';
dies_ok {
- Mouse::Meta::TypeConstraint->new(
+ Mouse::Meta::TypeConstraint::Parameterized->new(
name => 'Noncon[Int]',
parent => find_type_constraint('Noncon'),
type_parameter => find_type_constraint('Int'),
);
} 'non-containers cannot be parameterized';
-done_testing;