Acme-RFC4824

 view release on metacpan or  search on metacpan

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


my $packet = $sfss->decode({
    FRAME => $ascii,
});
if ($ENV{DEBUG}) {
    diag "Decoded packet (in hex): " . unpack('H*', $packet);
}
# test that decoding the ASCII representation yields the original packet
ok($packet eq $test_packet, 'Re-encoding yields original representation');

# test that adding errors that are cancelled using SUN (signal undo)
# does not change the resulting packet
my $frame_cancelled_errors = 'AAASSS' . $ascii;
$packet = $sfss->decode({
    FRAME => $frame_cancelled_errors,
});
if ($ENV{DEBUG}) {
    diag "Decoded packet (in hex): " . unpack('H*', $packet);
}
is(unpack('H*', $packet), unpack('H*', $test_packet), 'Signal Undo cancelling works');

$frame_cancelled_errors = 'ABCDEFGHAAAT' . $ascii;
$packet = $sfss->decode({
    FRAME => $frame_cancelled_errors,
});
if ($ENV{DEBUG}) {
    diag "Decoded packet (in hex): " . unpack('H*', $packet);
}
# test that adding errors that are cancelled using FUN (frame undo)
# does not change the resulting packet
ok($packet eq $test_packet, 'Frame Undo cancelling works');



( run in 0.306 second using v1.01-cache-2.11-cpan-65fba6d93b7 )