#!/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::Exception;
use Scalar::Util qw(refaddr);
# subtype with unions
{
- package Test::Mouse::Meta::TypeConstraint;
+ package Test::Mouse::Meta::TypeConstraint::Union;
use overload '""' => sub {'Broken|Test'}, fallback => 1;
use Mouse;
extends 'Mouse::Meta::TypeConstraint';
}
-my $dummy_instance = Test::Mouse::Meta::TypeConstraint->new;
+my $dummy_instance = Test::Mouse::Meta::TypeConstraint::Union->new;
ok $dummy_instance => "Created Instance";
isa_ok $dummy_instance,
- 'Test::Mouse::Meta::TypeConstraint' => 'isa correct type';
+ 'Test::Mouse::Meta::TypeConstraint::Union' => 'isa correct type';
is "$dummy_instance", "Broken|Test" =>
'Got expected stringification result';
my $foo = Mouse::Util::TypeConstraints::find_type_constraint('Foo');
my $bar = Mouse::Util::TypeConstraints::find_type_constraint('Bar');
- ok(!$foo->equals($bar), "Foo type is not equal to Bar type");
- ok( $foo->equals($foo), "Foo equals Foo");
+ ok(!$foo->is_a_type_of($bar), "Foo type is not equal to Bar type");
+ ok( $foo->is_a_type_of($foo), "Foo equals Foo");
ok( 0+$foo == refaddr($foo), "overloading works");
}