File: frame-accessors.t

package info (click to toggle)
libnet-stomp-perl 0.62-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: perl: 1,311; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl
use lib 't/lib';
use TestHelp;
use Net::Stomp::Frame;

my $f = Net::Stomp::Frame->new();

for my $h (qw(destination exchange content-type content-length message-id reply-to)) {
    subtest $h => sub {
        my $a = $h;$a=~s{-}{_}g;
        ok(!defined $f->headers->{$h},'header undef');
        ok(!defined $f->$a,'accessor returns undef');
        $f->$a('something');
        is($f->headers->{$h},'something','header set');
        is($f->$a,'something','accessor returns value');
    }
}

done_testing;