Remove the 2s from source code
This commit is contained in:
parent
a3565225ad
commit
d11ff14b57
115 changed files with 1473 additions and 1549 deletions
|
@ -10,12 +10,12 @@ path = "src/rpc.rs"
|
|||
doctest = false
|
||||
|
||||
[features]
|
||||
test-support = ["collections/test-support", "gpui2/test-support"]
|
||||
test-support = ["collections/test-support", "gpui/test-support"]
|
||||
|
||||
[dependencies]
|
||||
clock = { path = "../clock" }
|
||||
collections = { path = "../collections" }
|
||||
gpui2 = { path = "../gpui2", optional = true }
|
||||
gpui = { package = "gpui2", path = "../gpui2", optional = true }
|
||||
util = { path = "../util" }
|
||||
anyhow.workspace = true
|
||||
async-lock = "2.4"
|
||||
|
@ -37,7 +37,7 @@ prost-build = "0.9"
|
|||
|
||||
[dev-dependencies]
|
||||
collections = { path = "../collections", features = ["test-support"] }
|
||||
gpui2 = { path = "../gpui2", features = ["test-support"] }
|
||||
gpui = { package = "gpui2", path = "../gpui2", features = ["test-support"] }
|
||||
smol.workspace = true
|
||||
tempdir.workspace = true
|
||||
ctor.workspace = true
|
||||
|
|
|
@ -34,7 +34,7 @@ impl Connection {
|
|||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn in_memory(
|
||||
executor: gpui2::BackgroundExecutor,
|
||||
executor: gpui::BackgroundExecutor,
|
||||
) -> (Self, Self, std::sync::Arc<std::sync::atomic::AtomicBool>) {
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering::SeqCst},
|
||||
|
@ -53,7 +53,7 @@ impl Connection {
|
|||
#[allow(clippy::type_complexity)]
|
||||
fn channel(
|
||||
killed: Arc<AtomicBool>,
|
||||
executor: gpui2::BackgroundExecutor,
|
||||
executor: gpui::BackgroundExecutor,
|
||||
) -> (
|
||||
Box<dyn Send + Unpin + futures::Sink<WebSocketMessage, Error = anyhow::Error>>,
|
||||
Box<dyn Send + Unpin + futures::Stream<Item = Result<WebSocketMessage, anyhow::Error>>>,
|
||||
|
|
|
@ -342,7 +342,7 @@ impl Peer {
|
|||
pub fn add_test_connection(
|
||||
self: &Arc<Self>,
|
||||
connection: Connection,
|
||||
executor: gpui2::BackgroundExecutor,
|
||||
executor: gpui::BackgroundExecutor,
|
||||
) -> (
|
||||
ConnectionId,
|
||||
impl Future<Output = anyhow::Result<()>> + Send,
|
||||
|
@ -557,7 +557,7 @@ mod tests {
|
|||
use super::*;
|
||||
use crate::TypedEnvelope;
|
||||
use async_tungstenite::tungstenite::Message as WebSocketMessage;
|
||||
use gpui2::TestAppContext;
|
||||
use gpui::TestAppContext;
|
||||
|
||||
fn init_logger() {
|
||||
if std::env::var("RUST_LOG").is_ok() {
|
||||
|
@ -565,7 +565,7 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[gpui2::test(iterations = 50)]
|
||||
#[gpui::test(iterations = 50)]
|
||||
async fn test_request_response(cx: &mut TestAppContext) {
|
||||
init_logger();
|
||||
|
||||
|
@ -663,7 +663,7 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[gpui2::test(iterations = 50)]
|
||||
#[gpui::test(iterations = 50)]
|
||||
async fn test_order_of_response_and_incoming(cx: &mut TestAppContext) {
|
||||
let executor = cx.executor();
|
||||
let server = Peer::new(0);
|
||||
|
@ -761,7 +761,7 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[gpui2::test(iterations = 50)]
|
||||
#[gpui::test(iterations = 50)]
|
||||
async fn test_dropping_request_before_completion(cx: &mut TestAppContext) {
|
||||
let executor = cx.executor().clone();
|
||||
let server = Peer::new(0);
|
||||
|
@ -873,7 +873,7 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[gpui2::test(iterations = 50)]
|
||||
#[gpui::test(iterations = 50)]
|
||||
async fn test_disconnect(cx: &mut TestAppContext) {
|
||||
let executor = cx.executor();
|
||||
|
||||
|
@ -909,7 +909,7 @@ mod tests {
|
|||
.is_err());
|
||||
}
|
||||
|
||||
#[gpui2::test(iterations = 50)]
|
||||
#[gpui::test(iterations = 50)]
|
||||
async fn test_io_error(cx: &mut TestAppContext) {
|
||||
let executor = cx.executor();
|
||||
let (client_conn, mut server_conn, _kill) = Connection::in_memory(executor.clone());
|
||||
|
|
|
@ -616,7 +616,7 @@ pub fn split_worktree_update(
|
|||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[gpui2::test]
|
||||
#[gpui::test]
|
||||
async fn test_buffer_size() {
|
||||
let (tx, rx) = futures::channel::mpsc::unbounded();
|
||||
let mut sink = MessageStream::new(tx.sink_map_err(|_| anyhow!("")));
|
||||
|
@ -648,7 +648,7 @@ mod tests {
|
|||
assert!(stream.encoding_buffer.capacity() <= MAX_BUFFER_LEN);
|
||||
}
|
||||
|
||||
#[gpui2::test]
|
||||
#[gpui::test]
|
||||
fn test_converting_peer_id_from_and_to_u64() {
|
||||
let peer_id = PeerId {
|
||||
owner_id: 10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue