File: 03_scalar_ref.t

package info (click to toggle)
libdata-clone-perl 0.006-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208 kB
  • sloc: perl: 669; makefile: 8; ansic: 5
file content (22 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!perl -w

use strict;
use warnings FATAL => 'all';

use Test::More;

use Data::Clone;

for(1 .. 2){ # do it twice to test internal data

    my $s = 'foobar';
    my @a = (\substr $s, 1, 2);
    my $c = clone(\@a);

    is ${$c->[0]}, 'oo';
    ${$c->[0]} = 'xx';

    is $s, 'fxxbar', 'ScalarRef is copied in surface';
}

done_testing;