File: 76_attribute_hash.t

package info (click to toggle)
libgraph-perl 1%3A0.9726-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 996 kB
  • sloc: perl: 4,083; sh: 8; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use Test::More tests => 9;
package Hash;
use Graph::Attribute hash  => _A;
sub new { bless {}, shift }
package main;
use strict; use warnings;
my $o = Hash->new();
ok(!$o->_g_has_attributes());
is(my $a = $o->_g_get_attributes(), undef);
ok($o->_g_set_attributes({foo => 42}));
ok($o->_g_has_attributes());
ok($a = $o->_g_get_attributes());
is($a->{foo}, 42);
ok($o->_g_delete_attributes());
ok(!$o->_g_has_attributes());
is($a = $o->_g_get_attributes(), undef);