Commit f02fe403 authored by Tony Finn's avatar Tony Finn

Move test resources to dedicated folders

parent d64c2c27
......@@ -9,7 +9,7 @@ Obtaining the first password in the password database:
```rust
use kdbx_rs::{self, CompositeKey, Error};
fn main() -> Result<(), Error> {
let file_path = "./res/kdbx4-argon2.kdbx";
let file_path = "./res/test_input/kdbx4-argon2.kdbx";
let kdbx = kdbx_rs::open(file_path)?;
let key = CompositeKey::from_password("kdbxrs");
let unlocked = kdbx.unlock(&key)?;
......
......@@ -17,7 +17,7 @@
//! # fn main() -> Result<(), kdbx_rs::Error> {
//! use kdbx_rs::CompositeKey;
//!
//! # let file_path = "./res/kdbx4-argon2.kdbx";
//! # let file_path = "./res/test_input/kdbx4-argon2.kdbx";
//! let kdbx = kdbx_rs::open(file_path)?;
//! let key = CompositeKey::from_password("kdbxrs");
//! let unlocked = kdbx.unlock(&key)?;
......
......@@ -23,7 +23,7 @@ fn generate_xml() -> Result<(), kdbx_rs::Error> {
let mut expected_path = PathBuf::new();
expected_path.push(env!("CARGO_MANIFEST_DIR"));
expected_path.push("res");
expected_path.push("tests");
expected_path.push("test_output");
expected_path.push("generate_xml.xml");
let expected_xml_string = read_to_string(expected_path).unwrap().replace("\r\n", "\n");
......
......@@ -7,6 +7,7 @@ fn load_kdbx4_argon2() {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-argon2.kdbx");
let file = fs::File::open(file_path).unwrap();
......@@ -50,6 +51,7 @@ fn load_kdbx4_aes256() {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-aes256.kdbx");
let file = fs::File::open(file_path).unwrap();
......@@ -72,6 +74,7 @@ fn load_kdbx4_aes256_legacy() {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-aes256-legacy.kdbx");
let file = fs::File::open(file_path).unwrap();
......
......@@ -7,6 +7,7 @@ fn kdbx4_parsing() -> Result<(), kdbx_rs::Error> {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-argon2.kdbx");
let file = fs::File::open(file_path).unwrap();
......@@ -41,6 +42,7 @@ fn kdbx4_parsing_twofish() -> Result<(), kdbx_rs::Error> {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-argon2-twofish.kdbx");
let file = fs::File::open(file_path).unwrap();
......@@ -75,6 +77,7 @@ fn kdbx4_parsing_chacha20() -> Result<(), kdbx_rs::Error> {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-argon2-chacha20.kdbx");
let file = fs::File::open(file_path).unwrap();
......
......@@ -8,6 +8,7 @@ fn kdbx4_argon2() -> Result<(), kdbx_rs::Error> {
let mut file_path = PathBuf::new();
file_path.push(env!("CARGO_MANIFEST_DIR"));
file_path.push("res");
file_path.push("test_input");
file_path.push("kdbx4-argon2.kdbx");
let file = fs::File::open(file_path).unwrap();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment