File: base64.t

package info (click to toggle)
libtest-base-perl 0.88-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 668 kB
  • ctags: 106
  • sloc: perl: 931; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (9)
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);
    }
}