Debian Codegraph @

tests/duplicate-signatures.rs

raw
1 use assert_cmd::Command;
2 use std::path;
3
4 /// Asserts that duplicate signatures are properly ignored.
5 #[test]
6 fn ignore_duplicates() {
7 // Duplicate is ignored, but remaining one is ok.
8 Command::cargo_bin("sqv").expect("have sqv")
9 .current_dir(path::Path::new("tests").join("data"))
10 .args(&[
11 "--keyring",
12 "emmelie-dorothea-dina-samantha-awina-ed25519.pgp",
13 "a-cypherpunks-manifesto.txt.ed25519.sig.duplicated",
14 "a-cypherpunks-manifesto.txt",
15 ])
16 .unwrap();
17
18 // Duplicate is ignored, and fails to meet the threshold.
19 Command::cargo_bin("sqv").expect("have sqv")
20 .current_dir(path::Path::new("tests").join("data"))
21 .args(&[
22 "--keyring",
23 "emmelie-dorothea-dina-samantha-awina-ed25519.pgp",
24 "--signatures=2",
25 "a-cypherpunks-manifesto.txt.ed25519.sig.duplicated",
26 "a-cypherpunks-manifesto.txt",
27 ])
28 .assert()
29 .failure();
30 }