Make tests narrower.
Evidently the behavior on different platforms is different with regards to whether the final element in a list gets a comma or not, so we can't do a fully-string comparison of the debug output.
This commit is contained in:
parent
01e229346c
commit
aedbe6537b
|
|
@ -36,27 +36,12 @@ fn test_debug() {
|
||||||
let cert = include_bytes!("../../test/cert.pem");
|
let cert = include_bytes!("../../test/cert.pem");
|
||||||
let cert = X509::from_pem(cert).unwrap();
|
let cert = X509::from_pem(cert).unwrap();
|
||||||
let debugged = format!("{:#?}", cert);
|
let debugged = format!("{:#?}", cert);
|
||||||
let expected = r#"X509 {
|
assert!(debugged.contains(r#"serial_number: "8771F7BDEE982FA5""#));
|
||||||
serial_number: "8771F7BDEE982FA5",
|
assert!(debugged.contains(r#"signature_algorithm: sha256WithRSAEncryption"#));
|
||||||
signature_algorithm: sha256WithRSAEncryption,
|
assert!(debugged.contains(r#"countryName = "AU""#));
|
||||||
issuer: [
|
assert!(debugged.contains(r#"stateOrProvinceName = Some-State"#));
|
||||||
countryName = "AU",
|
assert!(debugged.contains(r#"not_before: Aug 14 17:00:03 2016 GMT"#));
|
||||||
stateOrProvinceName = "Some-State",
|
assert!(debugged.contains(r#"not_after: Aug 12 17:00:03 2026 GMT"#));
|
||||||
organizationName = "Internet Widgits Pty Ltd",
|
|
||||||
],
|
|
||||||
subject: [
|
|
||||||
countryName = "AU",
|
|
||||||
stateOrProvinceName = "Some-State",
|
|
||||||
organizationName = "Internet Widgits Pty Ltd",
|
|
||||||
commonName = "foobar.com",
|
|
||||||
],
|
|
||||||
not_before: Aug 14 17:00:03 2016 GMT,
|
|
||||||
not_after: Aug 12 17:00:03 2026 GMT,
|
|
||||||
public_key: PKey {
|
|
||||||
algorithm: "RSA",
|
|
||||||
},
|
|
||||||
}"#;
|
|
||||||
assert_eq!(expected, debugged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue