File: clone.t

package info (click to toggle)
libclass-makemethods-perl 1.01-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,944 kB
  • sloc: perl: 10,495; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 351 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/perl

use Test;
BEGIN { plan tests => 5 }

package X;

use Class::MakeMethods::Template::Ref 'clone' => 'duplicate';

sub new { my $class = shift; bless { @_ }, $class; }

package main;

my $o = X->new('foo' => 'bar');

ok( 1 );
ok( defined $o );
my $n;
ok( $n = $o->duplicate );
ok( $n->{'foo'} eq 'bar' );
ok( $n ne $o );

exit 0;