1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
use Test::Base;
plan tests => ~~blocks;
run_is;
__END__
=== Test One
--- encoded base64_decode
SSBMb3ZlIEx1Y3kK
--- decoded
I Love Lucy
=== Test Two
--- encoded
c3ViIHJ1bigmKSB7CiAgICBteSAkc2VsZiA9ICRkZWZhdWx0X29iamVjdDsKICAgIG15ICRjYWxs
YmFjayA9IHNoaWZ0OwogICAgZm9yIG15ICRibG9jayAoJHNlbGYtPmJsb2NrcykgewogICAgICAg
ICZ7JGNhbGxiYWNrfSgkYmxvY2spOwogICAgfQp9Cg==
--- decoded base64_encode
sub run(&) {
my $self = $default_object;
my $callback = shift;
for my $block ($self->blocks) {
&{$callback}($block);
}
}
|