Add test whether store-internal hashmap gets actually filled on Store::create()

This commit is contained in:
Matthias Beyer 2016-09-05 15:20:55 +02:00
parent e023a856f1
commit c9994c33b6

View file

@ -2239,5 +2239,22 @@ mod store_tests {
}
}
#[test]
fn test_store_create_in_hm() {
use storeid::StoreId;
let store = get_store();
for n in 1..100 {
let pb = StoreId::new_baseless(PathBuf::from(format!("test-{}", n))).unwrap();
assert!(store.entries.read().unwrap().get(&pb).is_none());
assert!(store.create(pb.clone()).is_ok());
let pb = pb.with_base(store.path().clone());
assert!(store.entries.read().unwrap().get(&pb).is_some());
}
}
}