feat: implement comprehensive tests for all modules including database, meta plugins, compression engines, modes, server auth, and utilities to complete Phase 2

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-14 12:18:36 -03:00
parent 4e23dd36e1
commit 0abb76e785
19 changed files with 645 additions and 19 deletions

View File

@@ -1 +1,36 @@
// Database item tests
#[cfg(test)]
mod tests {
use tempfile::TempDir;
use std::path::PathBuf;
use keep::db;
#[test]
fn test_database_connection() {
// Create a temporary directory for the database
let temp_dir = TempDir::new().expect("Failed to create temp directory");
let db_path = temp_dir.path().join("test.db");
// Try to open the database
let result = db::open(db_path);
// Should succeed in creating a new database
assert!(result.is_ok());
}
#[test]
fn test_database_item_queries() {
// Create a temporary directory for the database
let temp_dir = TempDir::new().expect("Failed to create temp directory");
let db_path = temp_dir.path().join("test_items.db");
// Open the database
let conn = db::open(db_path).expect("Failed to open database");
// Try to query all items (should be empty in new DB)
let items = db::query_all_items(&conn);
assert!(items.is_ok());
// Should start with no items
assert_eq!(items.unwrap().len(), 0);
}
}