Skip to content

Commit

Permalink
Add coverage for TimeStampResponse impl Deref
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten-adobe committed Nov 22, 2024
1 parent 2d085cd commit 4e03993
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion internal/crypto/src/tests/time_stamp/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test;

use crate::{asn1::rfc5652::CmsVersion, time_stamp::TimeStampResponse};
use crate::{
asn1::{rfc3161::PkiStatus, rfc5652::CmsVersion},
time_stamp::TimeStampResponse,
};

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
Expand Down Expand Up @@ -43,3 +46,13 @@ fn impl_debug() {
let x = format!("{tsr:?}");
assert!(!x.is_empty());
}

#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn impl_deref() {
let tsr = include_bytes!("../fixtures/time_stamp/video1.ts.bin");
let tsr = TimeStampResponse::parse(tsr).unwrap();

let tsr = &*tsr;
assert_eq!(tsr.status.status, PkiStatus::Granted);
}

0 comments on commit 4e03993

Please sign in to comment.