Created
December 14, 2010 06:37
-
-
Save motemen/740081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
{ | |
use Test::Builder; | |
use PadWalker; | |
no warnings 'redefine'; | |
my $ORIGINAL_ok = \&Test::Builder::ok; | |
*Test::Builder::ok = sub { | |
$_[2] ||= do { | |
package DB; | |
() = caller($Test::Builder::Level); | |
PadWalker::var_name $Test::Builder::Level + 1, \$DB::args[0]; | |
}; | |
goto &$ORIGINAL_ok; | |
}; | |
} | |
use Test::More 'no_plan'; | |
use Test::Deep; | |
my $x = 1; | |
my $user = { name => 'motemen', age => 17 }; | |
is $x, 1; | |
cmp_deeply $user, superhashof { name => 'motemen' }; | |
__END__ | |
ok 1 - $x | |
ok 2 - $user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment