Skip to content

Commit f8994fa

Browse files
authored
tests: test for secret key roundtrip (#14)
1 parent c0e3cb8 commit f8994fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/fs.rs

+13
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,16 @@ pub async fn load_secret_key(key_path: PathBuf) -> anyhow::Result<SecretKey> {
5353
Ok(secret_key)
5454
}
5555
}
56+
57+
#[cfg(test)]
58+
mod tests {
59+
use super::load_secret_key;
60+
#[tokio::test]
61+
async fn secret_key_roundtrip() {
62+
let dir = tempfile::tempdir().unwrap();
63+
let path = dir.path().join("key");
64+
let key1 = load_secret_key(path.clone()).await.unwrap();
65+
let key2 = load_secret_key(path).await.unwrap();
66+
assert_eq!(key1.to_bytes(), key2.to_bytes());
67+
}
68+
}

0 commit comments

Comments
 (0)