File: 76_attribute_hash.t

package info (click to toggle)
libgraph-perl 1%3A0.96-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,316 kB
  • ctags: 938
  • sloc: perl: 6,094; sh: 8; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 421 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 Hash;
use Graph::Attribute hash  => _A;
sub new { bless {}, shift }
package main;
my $o = Hash->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);