sub should_pass { my ($value, $constraint) = @_; ok( $constraint->check($value) ); } sub should_fail { my ($value, $constraint) = @_; ok( not $constraint->check($value) ); } should_pass(2222222, Int); should_fail(3.14159, Int);