Commit adds db from each session.
This commit is contained in:
@ -129,6 +129,23 @@ mod mtt {
|
||||
let store2 = mtt.session().await.unwrap();
|
||||
assert_eq!(store2.list(), [db]);
|
||||
}
|
||||
|
||||
#[async_std::test]
|
||||
async fn commit_from_multiple_sources() {
|
||||
let dir = tempdir().unwrap();
|
||||
let mtt1 = start_db(dir.path()).await.unwrap();
|
||||
let mtt2 = mtt1.clone();
|
||||
let db1 = "first";
|
||||
let db2 = "second";
|
||||
let mut store1 = mtt1.session().await.unwrap();
|
||||
let mut store2 = mtt2.session().await.unwrap();
|
||||
store1.add(db1).unwrap();
|
||||
store2.add(db2).unwrap();
|
||||
mtt1.commit(store1).await.unwrap();
|
||||
mtt2.commit(store2).await.unwrap();
|
||||
let output = mtt1.session().await.unwrap();
|
||||
assert_eq!(output.list(), [db1, db2]);
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn start_db<P>(dir: P) -> Result<MoreThanText, MTTError>
|
||||
|
Reference in New Issue
Block a user