ZIm/crates/collab2/src/tests.rs
Piotr Osiewicz e932f4cf47
Bump Rust to 1.75 (#3815)
**This PR also bumps wasmtime version from 0.38 to 2.0 as 0.38 does not
build with Rust 1.75**. I did not test the plugin runtime as (AFAIK) we
intend to deprecate it; also, wasmtime's most recent version is 16.0, so
it'd make sense to bump the version at some point anyways. I did not
bump the version to 16.0 straight away as that'd require code changes in
`plugin_runtime`.
Release Notes:

- N/A
2023-12-28 19:22:43 +01:00

47 lines
1.3 KiB
Rust

use call::Room;
use gpui::{Model, TestAppContext};
mod channel_buffer_tests;
mod channel_message_tests;
mod channel_tests;
mod editor_tests;
mod following_tests;
mod integration_tests;
mod notification_tests;
mod random_channel_buffer_tests;
mod random_project_collaboration_tests;
mod randomized_test_helpers;
mod test_server;
pub use randomized_test_helpers::{
run_randomized_test, save_randomized_test_plan, RandomizedTest, TestError, UserTestPlan,
};
pub use test_server::{TestClient, TestServer};
#[derive(Debug, Eq, PartialEq)]
struct RoomParticipants {
remote: Vec<String>,
pending: Vec<String>,
}
fn room_participants(room: &Model<Room>, cx: &mut TestAppContext) -> RoomParticipants {
room.read_with(cx, |room, _| {
let mut remote = room
.remote_participants()
.iter()
.map(|(_, participant)| participant.user.github_login.clone())
.collect::<Vec<_>>();
let mut pending = room
.pending_participants()
.iter()
.map(|user| user.github_login.clone())
.collect::<Vec<_>>();
remote.sort();
pending.sort();
RoomParticipants { remote, pending }
})
}
fn channel_id(room: &Model<Room>, cx: &mut TestAppContext) -> Option<u64> {
cx.read(|cx| room.read(cx).channel_id())
}