Skip to content

Commit ec8e7e8

Browse files
sseemayerlouib
andauthored
fix(test): feature-gate roundtrip tests (#249)
The roundtrip tests can only succeed if the database to be parsed in the test has been successfully generated at least one time, so tests will fail when the project was freshly cloned and the tests are run with the database missing. Put the whole roundtrip test module behind a feature gate, so that we test writing and reading at the same time. Co-authored-by: louib <[email protected]>
1 parent e4919d2 commit ec8e7e8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/large_database_roundtrip_tests.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg(feature = "save_kdbx4")]
12
mod large_file_roundtrip_tests {
23
use std::fs::File;
34

@@ -39,10 +40,8 @@ mod large_file_roundtrip_tests {
3940

4041
// Define database key.
4142
let key = DatabaseKey::new().with_password(TEST_DATABASE_PASSWORD);
42-
#[cfg(feature = "save_kdbx4")]
43-
{
44-
db.save(&mut File::create(TEST_DATABASE_FILE_NAME)?, key.clone())?;
45-
}
43+
db.save(&mut File::create(TEST_DATABASE_FILE_NAME)?, key.clone())?;
44+
4645
// Read the database that was written in the previous block.
4746
let db = Database::open(&mut File::open(TEST_DATABASE_FILE_NAME)?, key)?;
4847
// Validate that the data is what we expect.

0 commit comments

Comments
 (0)