File: hash_classkey.todo

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 (32 lines) | stat: -rw-r--r-- 550 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
25
26
27
28
29
30
31
32
#!/usr/bin/perl

use Test;
BEGIN { plan tests => 13 }

package X;

use Class::MakeMethods::Template::Hash (
  new     => 'new',
  'scalar'  => [ qw/ --class_keys a b c /]
);

package main;

my $o = X->new();

ok( 1 ); #1
ok( ! defined $o->a ); #2
ok( $o->a(123) ); #3
ok( ! defined $o->{a} ); #4
ok( defined $o->{'X::a'} ); #5
ok( $o->a == 123 ); #6
ok( ! defined $o->a(undef) ); #7
ok( ! defined $o->a ); #8
ok( $o->b(456) ); #9
ok( $o->b == 456 ); #10
ok( $o->a == 123 ); #11
ok( ! defined $o->a (undef) ); #12
ok( ! defined $o->a ); #13

exit 0;