Acme-RFC4824

 view release on metacpan or  search on metacpan

t/01-encode_decode.t  view on Meta::CPAN

}
# test that the number of characters in the ASCII string is the same as
# the number of ASCII art entries
is(scalar @ascii_art, length($ascii), 'ASCII art array has same number of elements as the string is long');

# test that the last entry is the representation of 'R' (FEN)
is($sfss->ascii2art_map()->{'R'}, $ascii_art[scalar @ascii_art - 1], 'Last symbol is R (FEN)');

# test packet from RFC 4824 authors
my $test_packet2 = pack('H*', '1e1f202122232425262728292a2b2c2d2e2f3031323334353637');
my $ascii2 = 'QABAABOBPCACBCCCDCECFCGCHCICJCKCLCMCNCOCPDADBDCDDDEDFDGDHLPOMR';
my $test = $sfss->decode({
    FRAME => $ascii2,
});
ok($test_packet2 eq $test, 'Test packet from RFC4824 authors decoding');

my $packet = $sfss->decode({
    FRAME => $ascii,
});
if ($ENV{DEBUG}) {
    diag "Decoded packet (in hex): " . unpack('H*', $packet);



( run in 0.507 second using v1.01-cache-2.11-cpan-39bf76dae61 )