factor storage out to a trait object

This commit is contained in:
Dustin J. Mitchell
2020-01-05 14:58:24 -05:00
parent e228c99b83
commit 611b1cd68f
11 changed files with 177 additions and 108 deletions

View File

@@ -1,8 +1,12 @@
use chrono::Utc;
use proptest::prelude::*;
use taskwarrior_rust::{Operation, Server, DB};
use taskwarrior_rust::{taskstorage, Operation, Server, DB};
use uuid::Uuid;
fn newdb() -> DB {
DB::new(Box::new(taskstorage::InMemoryStorage::new()))
}
#[derive(Debug)]
enum Action {
Op(Operation),
@@ -43,7 +47,7 @@ proptest! {
// another. So, the generated sequences focus on a single task UUID.
fn transform_sequences_of_operations(action_sequence in action_sequence_strategy()) {
let mut server = Server::new();
let mut dbs = [DB::new(), DB::new(), DB::new()];
let mut dbs = [newdb(), newdb(), newdb()];
for (action, db) in action_sequence {
println!("{:?} on db {}", action, db);