Permalink
Browse files

Added some unit tests

  • Loading branch information...
1 parent 401c336 commit 26703dada1e366145716cb7808ffbd20d07206e3 @Leont committed Dec 8, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 t/basic.t
View
@@ -27,6 +27,9 @@ foreach my $obj ( bless({}, "Foo"), bless([], "Bar") ) {
ok( $obj ~~ inv_isa("Bar"), "isa Bar" );
ok( not ( $obj ~~ inv_can("not_a_method") ), "can't nonexistent method" );
ok( not ( $obj ~~ inv_isa("NotAClass") ), "not isa non existent class" );
+ ok( not ( $obj ~~ non_ref ), '$obj is not a non_ref');
+ ok( $obj ~~ any, '$obj is any');
+ ok( not ( $obj ~~ none ), '$obj isn\'t none');
}
ok( bless({}, "Foo") ~~ overloaded, "object Foo is overloaded" );
@@ -36,3 +39,8 @@ ok( not( "Foo" ~~ overloaded ), "but not the class itself" );
ok( not( bless({}, "Bar") ~~ overloaded ), "object Bar is not overloaded" );
ok( "Foo" ~~ inv_can("blah"), "Class can methods too" );
+
+ok( 'Non empty string' ~~ non_empty_string, 'Non empty string is indeed non-empty');
+
+ok( 'foobar' ~~ string_length_is(6));
+

0 comments on commit 26703da

Please sign in to comment.