Skip to content

Commit

Permalink
rust: Get remaining coverage in PublicKeyErrorOps
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuo-cpp committed Oct 25, 2023
1 parent 4f0d995 commit 548073d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rust/cryptography-x509-validation/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,15 @@ Xw4nMqk=
assert!(cert_is_self_issued(&cert));
assert!(!cert_is_self_signed(&cert, &ops));
}

#[test]
fn test_certificate_public_key_error_ops() {
// Just to get coverage on the `PublicKeyErrorOps` helper.
let cert_pem = ca_pem();
let cert = cert(&cert_pem);
let ops = PublicKeyErrorOps {};

assert!(ops.public_key(&cert).is_err());
assert!(ops.verify_signed_by(&cert, ()).is_ok());
}
}

0 comments on commit 548073d

Please sign in to comment.