22 lines
772 B
Rust
22 lines
772 B
Rust
use std::process::Command;
|
|
|
|
#[test]
|
|
fn parses_sample_der_certificate_list() {
|
|
// Path to the compiled binary provided by Cargo during tests
|
|
let bin = env!("CARGO_BIN_EXE_asn1parse");
|
|
|
|
let output = Command::new(bin)
|
|
.args([
|
|
"--file", "tests/data/test.cert.der",
|
|
"--input-format", "der",
|
|
"--color", "never",
|
|
])
|
|
.output()
|
|
.expect("failed to run asn1parse binary");
|
|
|
|
assert!(output.status.success(), "binary exited with non-zero status");
|
|
let stdout = String::from_utf8_lossy(&output.stdout);
|
|
assert!(stdout.contains("SEQUENCE"), "missing SEQUENCE: {stdout}");
|
|
assert!(stdout.contains("INTEGER") || stdout.contains("OBJECT IDENTIFIER"), "missing common ASN.1 types: {stdout}");
|
|
}
|