1#!perl
2
3use strict ("subs", "vars", "refs");
4use warnings ("all");
5BEGIN { $ENV{CLONE_CHOOSE_PREFERRED_BACKEND} = "Storable"; }
6END { delete $ENV{CLONE_CHOOSE_PREFERRED_BACKEND} } # for VMS
7
8use Scalar::Util qw(refaddr);
9use Test::More;
10
11BEGIN
12{
13    $ENV{CLONE_CHOOSE_PREFERRED_BACKEND} and eval "use $ENV{CLONE_CHOOSE_PREFERRED_BACKEND}; 1;";
14    $@ and plan skip_all => "No $ENV{CLONE_CHOOSE_PREFERRED_BACKEND} found.";
15}
16
17use Clone::Choose;
18
19my $string = "Scalar";
20$string = \$string;
21my $cloned_string = clone $string;
22
23ok(refaddr $string != refaddr $cloned_string, "Scalar String");
24
25my $numeric = 3.141;
26$numeric = \$numeric;
27my $cloned_numeric = clone $numeric;
28
29ok(refaddr $numeric != refaddr $cloned_numeric, "Scalar Numeric");
30
31my $undef = undef;
32$undef = \$undef;
33my $cloned_undef = clone $undef;
34
35ok(refaddr $undef != refaddr $cloned_undef, "Scalar Undef");
36
37done_testing;
38
39
40