File: inline_subclass.t

package info (click to toggle)
libio-all-perl 0.33-3.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 460 kB
  • ctags: 292
  • sloc: perl: 2,092; makefile: 46
file content (43 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
use lib 't', 'lib';

package IO::Dumper;
use IO::All '-Base';
use Data::Dumper;

package IO::All::Filesys;
sub dump {
    $self->print(Data::Dumper::Dumper(@_));
    return $self;
} 

package main;
use Test::More tests => 5;
use IO_All_Test;

IO::Dumper->import;

my $hash = {
    red => 'square',
    yellow => 'circle',
    pink => 'triangle',
};

die if -f 't/output/dump1';
my $io = io('t/output/dump1')->file->dump($hash);
ok(-f 't/output/dump1');
ok($io->close);
ok(-s 't/output/dump1');

my $VAR1;
my $a = do 't/output/dump1';
my $b = eval join('',<DATA>);
is_deeply($a,$b);

ok($io->unlink);

__END__
$VAR1 = {
  'pink' => 'triangle',
  'red' => 'square',
  'yellow' => 'circle'
};