Skip to content

Commit

Permalink
test: fix broken tests that worked because of ignored errors
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Nov 15, 2023
1 parent a9fd880 commit 71e0ca0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ mod tests {
K: 'a + Future<Output = Result<T>>,
{
generic_with_uid(
"OK COPY completed\r\n",
"A0001 OK COPY completed\r\n",
"COPY",
"2:4",
"MEETING",
Expand Down Expand Up @@ -2094,7 +2094,15 @@ mod tests {
F: 'a + FnOnce(Arc<Mutex<Session<MockStream>>>, &'a str, &'a str) -> K,
K: 'a + Future<Output = Result<T>>,
{
generic_with_uid("OK FETCH completed\r\n", "FETCH", "1", "BODY[]", prefix, op).await;
generic_with_uid(
"A0001 OK FETCH completed\r\n",
"FETCH",
"1",
"BODY[]",
prefix,
op,
)
.await;
}

async fn generic_with_uid<'a, F, T, K>(
Expand All @@ -2108,7 +2116,7 @@ mod tests {
F: 'a + FnOnce(Arc<Mutex<Session<MockStream>>>, &'a str, &'a str) -> K,
K: 'a + Future<Output = Result<T>>,
{
let resp = format!("A0001 {}\r\n", res).as_bytes().to_vec();
let resp = res.as_bytes().to_vec();
let line = format!("A0001{}{} {} {}\r\n", prefix, cmd, seq, query);
let session = Arc::new(Mutex::new(mock_session!(MockStream::new(resp))));

Expand Down

0 comments on commit 71e0ca0

Please sign in to comment.