MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_pooled_bytes_mut_operations

Function test_pooled_bytes_mut_operations

src/protocol/buffer_pool.rs:504–517  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

502
503 #[test]
504 fn test_pooled_bytes_mut_operations() {
505 let pool = BufferPool::new();
506 let mut buffer = pool.get_buffer();
507
508 assert!(buffer.is_empty());
509 assert!(buffer.capacity() > 0);
510
511 buffer.buffer_mut().extend_from_slice(b"hello");
512 assert_eq!(buffer.len(), 5);
513 assert!(!buffer.is_empty());
514
515 buffer.clear();
516 assert!(buffer.is_empty());
517 }
518
519 #[test]
520 fn test_global_buffer_pool() {

Callers

nothing calls this directly

Calls 3

get_bufferMethod · 0.80
buffer_mutMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected