mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Fix empty-dir problem with server also, and add tests
This commit is contained in:
parent
c3bc93f631
commit
75f0447c7b
2 changed files with 31 additions and 0 deletions
|
@ -351,6 +351,25 @@ mod test {
|
|||
use crate::storage::taskmap_with;
|
||||
use tempfile::TempDir;
|
||||
|
||||
#[test]
|
||||
fn test_empty_dir() -> anyhow::Result<()> {
|
||||
let tmp_dir = TempDir::new()?;
|
||||
let non_existant = tmp_dir.path().join("subdir");
|
||||
let mut storage = SqliteStorage::new(&non_existant)?;
|
||||
let uuid = Uuid::new_v4();
|
||||
{
|
||||
let mut txn = storage.txn()?;
|
||||
assert!(txn.create_task(uuid)?);
|
||||
txn.commit()?;
|
||||
}
|
||||
{
|
||||
let mut txn = storage.txn()?;
|
||||
let task = txn.get_task(uuid)?;
|
||||
assert_eq!(task, Some(taskmap_with(vec![])));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn drop_transaction() -> anyhow::Result<()> {
|
||||
let tmp_dir = TempDir::new()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue