Loading openssl/src/x509/tests.rs +6 −21 Original line number Diff line number Diff line Loading @@ -36,27 +36,12 @@ fn test_debug() { let cert = include_bytes!("../../test/cert.pem"); let cert = X509::from_pem(cert).unwrap(); let debugged = format!("{:#?}", cert); let expected = r#"X509 { serial_number: "8771F7BDEE982FA5", signature_algorithm: sha256WithRSAEncryption, issuer: [ countryName = "AU", stateOrProvinceName = "Some-State", 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); assert!(debugged.contains(r#"serial_number: "8771F7BDEE982FA5""#)); assert!(debugged.contains(r#"signature_algorithm: sha256WithRSAEncryption"#)); assert!(debugged.contains(r#"countryName = "AU""#)); assert!(debugged.contains(r#"stateOrProvinceName = Some-State"#)); assert!(debugged.contains(r#"not_before: Aug 14 17:00:03 2016 GMT"#)); assert!(debugged.contains(r#"not_after: Aug 12 17:00:03 2026 GMT"#)); } #[test] Loading Loading
openssl/src/x509/tests.rs +6 −21 Original line number Diff line number Diff line Loading @@ -36,27 +36,12 @@ fn test_debug() { let cert = include_bytes!("../../test/cert.pem"); let cert = X509::from_pem(cert).unwrap(); let debugged = format!("{:#?}", cert); let expected = r#"X509 { serial_number: "8771F7BDEE982FA5", signature_algorithm: sha256WithRSAEncryption, issuer: [ countryName = "AU", stateOrProvinceName = "Some-State", 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); assert!(debugged.contains(r#"serial_number: "8771F7BDEE982FA5""#)); assert!(debugged.contains(r#"signature_algorithm: sha256WithRSAEncryption"#)); assert!(debugged.contains(r#"countryName = "AU""#)); assert!(debugged.contains(r#"stateOrProvinceName = Some-State"#)); assert!(debugged.contains(r#"not_before: Aug 14 17:00:03 2016 GMT"#)); assert!(debugged.contains(r#"not_after: Aug 12 17:00:03 2026 GMT"#)); } #[test] Loading