comparison _test/Test/Lang.pm @ 179:b3d91ff7aea9

minor changes
author sourcer
date Tue, 20 Dec 2011 23:00:30 +0300
parents 74c27daf2e7b
children d1676be8afcc
comparison
equal deleted inserted replaced
178:658a80d19d33 179:b3d91ff7aea9
4 4
5 use parent qw(IMPL::Test::Unit); 5 use parent qw(IMPL::Test::Unit);
6 6
7 use IMPL::Test qw(test failed assert); 7 use IMPL::Test qw(test failed assert);
8 use IMPL::lang qw(:hash :compare clone); 8 use IMPL::lang qw(:hash :compare clone);
9 use Scalar::Util qw(reftype);
9 10
10 __PACKAGE__->PassThroughArgs; 11 __PACKAGE__->PassThroughArgs;
11 12
12 test equals => sub { 13 test equals => sub {
13 assert( equals(1,1) ); 14 assert( equals(1,1) );
80 81
81 my $b = clone($a); 82 my $b = clone($a);
82 83
83 assert(not defined $b); 84 assert(not defined $b);
84 85
85 my $lp = { a => '1' }; 86 my $lp = { a => '1', rx => qr/abc$/ };
86 $lp->{b} = $lp; 87 $lp->{b} = $lp;
87 88
88 my $c = clone($lp); 89 my $c = clone($lp);
89 90
90 assert($c); 91 assert($c);
91 assert($c->{b}); 92 assert($c->{b});
92 assert($c->{b} == $c); 93 assert($c->{b} == $c);
94 assert(reftype $c->{rx} eq 'REGEXP');
93 95
94 }; 96 };
95 97
96 test hashParse => sub { 98 test hashParse => sub {
97 my $res = hashParse("a = test a\nb = test b\nc c=test c"); 99 my $res = hashParse("a = test a\nb = test b\nc c=test c");