Skip to content

Commit 3643617

Browse files
committed
Enhance debug message for fair_queue tests
1 parent 84c9050 commit 3643617

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/fair_queue.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,6 @@ mod test {
220220
}
221221
}
222222

223-
fn poll_debug<T>(poll: Poll<Option<T>>) -> &'static str {
224-
match poll {
225-
Poll::Ready(Some(_)) => "Ready(Some(_))",
226-
Poll::Ready(None) => "Ready(None)",
227-
Poll::Pending => "Pending",
228-
}
229-
}
230-
231223
#[async_rt::test]
232224
async fn test_fair_queue_ready() {
233225
let a = stream::iter(vec!["a1", "a2", "a3"]);
@@ -323,7 +315,7 @@ mod test {
323315
assert_eq!(key, "fast");
324316
assert_eq!(value, "f1");
325317
}
326-
other => panic!("Expected fast stream first, got: {:?}", poll_debug(other)),
318+
other => panic!("Expected fast stream first, got: {:#?}", other),
327319
}
328320

329321
// Second poll: fast stream still ready, slow stream pending
@@ -333,14 +325,14 @@ mod test {
333325
assert_eq!(key, "fast");
334326
assert_eq!(value, "f2");
335327
}
336-
other => panic!("Expected fast stream second, got: {:?}", poll_debug(other)),
328+
other => panic!("Expected fast stream second, got: {:#?}", other),
337329
}
338330

339331
// Third poll: With noop_waker, slow stream hasn't been re-polled
340332
let result = Pin::new(&mut fair_queue).poll_next(&mut cx);
341333
match result {
342334
Poll::Pending => {} // Expected with noop_waker
343-
other => panic!("Expected Pending, got: {:?}", poll_debug(other)),
335+
other => panic!("Expected Pending, got: {:#?}", other),
344336
}
345337
}
346338

0 commit comments

Comments
 (0)