Group
Extension

Matches 6

Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/06mg.t ( view source; MetaCPAN )
 $no = 'no ';
    }

    return ok($ok, $name);
}

sub is_flag   { return _test_flag 0, @_; }
sub isnt_flag { return _test_flag 1, @_; }

sub oneliner {
    my ($perl) = @_;
    my ($SCRIPT, $script) 
\PVBM);
    my $pvbm   = clone \PVBM;

    isa_ok  b($pvbm),       $type,      'PVBM cloned';
    isnt    $pvbm,          \PVBM,      '...not a copy';
    has_mg  \PVBM,          'B',        '(sanity 
  'D',        '@+ loses magic';
    is_deeply   $Dmg,       \@+,        '...but keeps value';
    isnt        \$Dmg->[0], \$+[0],     '...not copied';

    has_mg      \$+[0],     'd',        '(sanity
Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/05cv.t ( view source; MetaCPAN )
 my $cv  = clone $sub;

    isa_ok  b($cv),             'B::CV',            'closure cloned';
    isnt    $cv,                $sub,               '...not copied';
    is      $cv->(3),           6,   
ount++;
        return wantarray ? (\$x, scalar $cv->()) : \$x;
    };
    $cv = clone $sub;

    isnt    scalar $cv->(), scalar $sub->(),    'new lexicals clone';

    $count = 0;
    my @rv = $sub->
     my $c;
        return sub { \$c };
    }

    my $sub = clos;
    my $cv  = clone $sub;

    isnt $cv->(), $sub->(), 'lexical from sub scope is cloned';
}

TODO: {
    local $TODO = 'loops not de
Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/04hv.t ( view source; MetaCPAN )
   my $hv = clone \%hash;

    isa_ok  b($hv),             'B::HV',        'empty HV cloned';
    isnt    $hv,                \%hash,         '...not copied';
    is      scalar(keys %$hv),  0,       
        'HV keys cloned';
    is      $hv->{a},           'b',            'HV values cloned';
    isnt    \$hv->{a},          \$hash{a},      '...not copied';
}

SKIP: {
    my $skip;
    eval 'requir
hv        = clone $href;

    isa_ok  b($hv->{a}),        'B::HV',        'nested HV cloned';
    isnt    $hv->{a},           $href->{a},     '...not copied';
    is      $hv->{a}{b},        'c',     
Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/03av.t ( view source; MetaCPAN )
    my $av = clone \@ary;

    isa_ok  b($av),             'B::AV',        'empty AV cloned';
    isnt    $av,                \@ary,          '...not copied';
    is      @$av,               0,       
      'AV size cloned';
    is      $av->[1],           'two',          'AV contents cloned';
    isnt    \$av->[1],          \$ary[1],       '...not copied';
}

{
    BEGIN { $tests += 5 }

    my $a
av        = clone $aref;

    isa_ok  b($av->[1]),        'B::AV',        'nested AV cloned';
    isnt    $av->[1],           $aref->[1],     '...not copied';
    is      $av->[1][0],        2,       
Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/02rv.t ( view source; MetaCPAN )
    $RVc,           'RV cloned';
    ok      b(\$rv)->ROK,                   '...and is ROK';
    isnt    $rv,            \$scalar,       '...not copied';
    is      $$rv,           5,              '
          'circular ref cloned';
    ok      b(\$rv)->ROK,                   '...and is ROK';
    isnt    $rv,           \$circ,          '...not copied';
    is      $$rv,          $rv,             '
             '...and ROK';
    is      blessed($rv),  'Foo',           '...preserving class';
    isnt    refaddr($rv),  refaddr($blessed),
                                            '...not copied';
Clone-Closure ( B/BM/BMORROW/Clone-Closure-0.06.tar.gz, BMORROW, 2010; MetaCPAN )
Clone-Closure/t/03scalar.t ( view source; MetaCPAN )
$y,    'NVs clone';
isnt    $x,         $y,     '...not copy';

my $c = \"test 2 scalar";
my $d = clone $c;

BEGIN { $tests += 2 }
is      $$c,    $$d,            'refs clone';
isnt    $c,     $d,    

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.