MCPcopy Create free account
hub / github.com/aws/clock-bound / buffer_overflow

Function buffer_overflow

clock-bound/src/daemon/async_ring_buffer.rs:315–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313
314 #[tokio::test]
315 async fn buffer_overflow() {
316 let (tx, rx) = create(2);
317 tx.send(1).unwrap();
318 tx.send(2).unwrap();
319 tx.send(3).unwrap(); // This should overwrite the oldest value (1)
320
321 assert_eq!(rx.recv().await.unwrap(), 2); // First value (1) was overwritten
322 assert_eq!(rx.recv().await.unwrap(), 3);
323 }
324
325 #[tokio::test]
326 async fn sender_drop() {

Callers

nothing calls this directly

Calls 2

createFunction · 0.85
sendMethod · 0.80

Tested by

no test coverage detected