diff --git a/src/tests.rs b/src/tests.rs index b49ff77..48048ff 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -34,6 +34,25 @@ mod tests { dir.close().expect("Failed to remove temporary directory"); } + // Helper function to create test items with specific content and tags + fn create_test_items(dir: &Path, f: F) + where + F: FnOnce(&str, &str), + { + // Set the data directory for this test + let env = format!("KEEP_DIR={} cargo run --", dir.display()); + + // Create test items + let input_a = "test content A"; + let input_b = "test content B"; + + // Create first item with tag_a + f(input_a, "tag_a"); + + // Create second item with tag_b + f(input_b, "tag_b"); + } + // Helper function to check if a file exists in the data directory fn file_exists(data_dir: &Path, id: i64) -> bool { let path = data_dir.join(id.to_string());