mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
Fix randomized collaboration tests in language
This commit is contained in:
parent
c9478cab09
commit
76d6c00e0c
2 changed files with 5 additions and 1 deletions
|
@ -61,4 +61,5 @@ env_logger = "0.8"
|
|||
rand = "0.8.3"
|
||||
tree-sitter-json = "*"
|
||||
tree-sitter-rust = "*"
|
||||
tree-sitter-typescript = "*"
|
||||
unindent = "0.1.7"
|
||||
|
|
|
@ -730,10 +730,13 @@ fn test_random_collaboration(cx: &mut MutableAppContext, mut rng: StdRng) {
|
|||
let mut replica_ids = Vec::new();
|
||||
let mut buffers = Vec::new();
|
||||
let network = Rc::new(RefCell::new(Network::new(rng.clone())));
|
||||
let base_buffer = cx.add_model(|cx| Buffer::new(0, base_text.as_str(), cx));
|
||||
|
||||
for i in 0..rng.gen_range(min_peers..=max_peers) {
|
||||
let buffer = cx.add_model(|cx| {
|
||||
let mut buffer = Buffer::new(i as ReplicaId, base_text.as_str(), cx);
|
||||
let mut buffer =
|
||||
Buffer::from_proto(i as ReplicaId, base_buffer.read(cx).to_proto(), None, cx)
|
||||
.unwrap();
|
||||
buffer.set_group_interval(Duration::from_millis(rng.gen_range(0..=200)));
|
||||
let network = network.clone();
|
||||
cx.subscribe(&cx.handle(), move |buffer, _, event, _| {
|
||||
|
|
Loading…
Reference in a new issue