use super::*;
use tempfile::TempDir;
#[tokio::test]
async fn test_database_open_close() {
let temp_dir = TempDir::new().unwrap();
let config = Config::test_config();
let db = Database::open(temp_dir.path(), config).await.unwrap();
db.close().await.unwrap();
}
#[cfg(feature = "state_machine")]
#[test]
fn test_open_with_discovered_sstables_and_registry_is_crate_private() {
assert!(
true,
"open_with_discovered_sstables_and_registry is correctly marked pub(crate)"
);
}
#[tokio::test]
#[cfg(feature = "state_machine")]
async fn test_database_open_with_discovered_sstables() {
let temp_dir = TempDir::new().unwrap();
let config = Config::test_config();
let discovered_dirs = Vec::new();
let db = Database::open_with_discovered_sstables(temp_dir.path(), discovered_dirs, config)
.await
.unwrap();
let stats = db.stats().await.unwrap();
assert_eq!(stats.storage_stats.sstables.sstable_count, 0);
db.close().await.unwrap();
}