ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-BER-XS/t/02_simple.t
(Generate patch)

Comparing Convert-BER-XS/t/02_simple.t (file contents):
Revision 1.2 by root, Sat Apr 20 15:23:26 2019 UTC vs.
Revision 1.3 by root, Sat Apr 20 15:57:28 2019 UTC

1BEGIN { $| = 1; print "1..88\n"; } 1BEGIN { $| = 1; print "1..92\n"; }
2 2
3use common::sense; 3use common::sense;
4use Convert::BER::XS ':all'; 4use Convert::BER::XS ':all';
5 5
6our $test; 6our $test;
30 30
31 ok (!eval { ber_decode pack "H*", $hex; 1 }, "# fail $hex"); 31 ok (!eval { ber_decode pack "H*", $hex; 1 }, "# fail $hex");
32 $@ =~ s/ at .*//s; 32 $@ =~ s/ at .*//s;
33 ok ($@ =~ $match, "# $@ =~ $match"); 33 ok ($@ =~ $match, "# $@ =~ $match");
34} 34}
35
36roundtrip "1f020105", [ASN_UNIVERSAL, ASN_INTEGER, 0, 5], "020105";
37roundtrip "1f80020105", [ASN_UNIVERSAL, ASN_INTEGER, 0, 5], "020105";
35 38
36roundtrip "020105", [ASN_UNIVERSAL, ASN_INTEGER, 0, 5]; 39roundtrip "020105", [ASN_UNIVERSAL, ASN_INTEGER, 0, 5];
37roundtrip "0201ff", [ASN_UNIVERSAL, ASN_INTEGER, 0, -1]; 40roundtrip "0201ff", [ASN_UNIVERSAL, ASN_INTEGER, 0, -1];
38roundtrip "020200ff", [ASN_UNIVERSAL, ASN_INTEGER, 0, 255]; 41roundtrip "020200ff", [ASN_UNIVERSAL, ASN_INTEGER, 0, 255];
39roundtrip "0204ffffffff", [ASN_UNIVERSAL, ASN_INTEGER, 0, -1], "0201ff"; 42roundtrip "0204ffffffff", [ASN_UNIVERSAL, ASN_INTEGER, 0, -1], "0201ff";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines