File: 75_attribute_array.t

package info (click to toggle)
libgraph-perl 1%3A0.91-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,152 kB
  • ctags: 590
  • sloc: perl: 6,065; makefile: 37; sh: 8
file content (15 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More tests => 9;
package Array;
use Graph::Attribute array => 0;
sub new { bless [], shift }
package main;
my $o = Array->new();
ok(!$o->_has_attributes());
is(my $a = $o->_get_attributes(), undef);
ok($o->_set_attributes({foo => 42}));
ok($o->_has_attributes());
ok($a = $o->_get_attributes());
is($a->{foo}, 42);
ok($o->_delete_attributes());
ok(!$o->_has_attributes());
is($a = $o->_get_attributes(), undef);