diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_oid.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_oid.rs b/tests/test_oid.rs new file mode 100644 index 0000000..b85d622 --- /dev/null +++ b/tests/test_oid.rs @@ -0,0 +1,15 @@ +use asn1_rs_impl::{encode_int, encode_oid}; + +#[test] +fn test_encode_oid() { + // example from http://luca.ntop.org/Teaching/Appunti/asn1.html + let oid = encode_oid! {1.2.840.113549}; + assert_eq!(oid, [0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d]); +} + +#[test] +fn test_encode_int() { + // + let int = encode_int!(1234); + assert_eq!(int, [0x04, 0xd2]); +} |