The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More;
use Test::Fatal;

use Moose;

{
    my $tr = Moose::Meta::TypeConstraint::Registry->new();

    my $exception = exception {
        $tr->add_type_constraint('xyz');
    };

    like(
        $exception,
        qr!No type supplied / type is not a valid type constraint!,
        "'xyz' is not a Moose::Meta::TypeConstraint");

    isa_ok(
        $exception,
        'Moose::Exception::InvalidTypeConstraint',
        "'xyz' is not a Moose::Meta::TypeConstraint");
}

done_testing;