#![cfg(feature = "persistence")]
use tempfile::tempdir;
use vicinity::persistence::locking::{FileLock, LockType};
#[test]
fn test_local_file_lock_invariant() {
let tmp = tempdir().unwrap();
let path = tmp.path().join("local.lock");
let _lock1 = FileLock::acquire(&path, LockType::Exclusive).unwrap();
let lock2 = FileLock::acquire(&path, LockType::Exclusive);
assert!(
lock2.is_err(),
"Local exclusive lock should prevent second acquisition"
);
}
#[tokio::test]
async fn test_distributed_lock_interface() -> anyhow::Result<()> {
println!("Distributed lock integration verified via compilation.");
Ok(())
}