#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 11;
+use Test::More tests => 14;
use Test::Exception;
require Class::MOP;
throws_ok { Class::MOP::load_class('') } qr/Invalid class name \(\)/;
throws_ok { Class::MOP::load_class(\"foo") } qr/Invalid class name \(SCALAR\(\w+\)\)/;
-ok(Class::MOP::load_class('BinaryTree'));
+my $meta = Class::MOP::load_class('BinaryTree');
+ok($meta, "successfully loaded the class BinaryTree");
+is($meta->name, "BinaryTree", "load_class returns the metaclass");
can_ok('BinaryTree' => 'traverse');
do {
Class::MOP::load_class('SyntaxError');
} qr/Missing right curly/;
+{
+ package Other;
+ use constant foo => "bar";
+}
+
+lives_ok { ok(Class::MOP::is_class_loaded("Other")) } "a class with just constants is still a class";