use dark_std::sync::{SyncBtreeMap, SyncHashMap, SyncIndexMap, SyncVec};
#[test]
fn sync_btree_map_race() {
let map: SyncBtreeMap<bool, bool> = SyncBtreeMap::new();
map.insert(true, true);
std::thread::scope(|s| {
s.spawn(|| {
map.dirty_ref();
});
map.remove(&true);
});
}
#[test]
fn sync_hash_map_race() {
let map: SyncHashMap<bool, bool> = SyncHashMap::new();
std::thread::scope(|s| {
s.spawn(|| {
map.get(&true);
});
map.insert(true, true);
});
}
#[test]
fn sync_vec_race() {
let vec: SyncVec<bool> = SyncVec::new();
vec.push(true);
std::thread::scope(|s| {
s.spawn(|| {
vec.get(0);
});
vec.push(false);
});
}
#[test]
fn sync_index_map_race() {
let map: SyncIndexMap<bool, bool> = SyncIndexMap::new();
std::thread::scope(|s| {
s.spawn(|| {
map.dirty_ref();
});
map.insert(true, true);
});
}