summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/mod.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-05-14 14:05:24 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-05-14 15:31:31 +0200
commit09f470d2762dc8aeff2b97369285c9cfb97d03ea (patch)
treeaf275c2882bcdd764c6d1c00a35a6ea3a9f4d0a5 /openpgp/src/crypto/mod.rs
parent0e74cf1b42b239e26d21b531e6ba3694e6f9361c (diff)
openpgp: Add a filesystem-like framework for test data.
- Fixes #267.
Diffstat (limited to 'openpgp/src/crypto/mod.rs')
-rw-r--r--openpgp/src/crypto/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs
index 362c1e58..e75e4ccb 100644
--- a/openpgp/src/crypto/mod.rs
+++ b/openpgp/src/crypto/mod.rs
@@ -214,7 +214,6 @@ pub fn hash_file<R: Read>(reader: R, algos: &[HashAlgorithm])
#[test]
fn hash_file_test() {
use std::collections::HashMap;
- use std::fs::File;
let expected: HashMap<HashAlgorithm, &str> = [
(HashAlgorithm::SHA1, "7945E3DA269C25C04F9EF435A5C0F25D9662C771"),
@@ -222,7 +221,7 @@ fn hash_file_test() {
].iter().cloned().collect();
let result =
- hash_file(File::open(::path_to("a-cypherpunks-manifesto.txt")).unwrap(),
+ hash_file(::std::io::Cursor::new(::tests::manifesto()),
&expected.keys().cloned().collect::<Vec<HashAlgorithm>>())
.unwrap();