MCPcopy Create free account
hub / github.com/cosdata/cosdata / prop_write_with_cursor

Function prop_write_with_cursor

src/models/buffered_io.rs:1564–1573  ·  view source on GitHub ↗
(size: u16)

Source from the content-addressed store, hash-verified

1562 // value (write offset) is `EOF - buffer_size` (0 in this case)
1563 #[quickcheck]
1564 fn prop_write_with_cursor(size: u16) -> bool {
1565 let bufsize = size as usize;
1566 let file = create_tmp_file_of_size(0).unwrap();
1567 let bufman = BufferManager::new(file, BUFFER_SIZE).unwrap();
1568 let buffer = vec![0; bufsize];
1569 let cursor = bufman.open_cursor().unwrap();
1570 let written_at = bufman.write_with_cursor(cursor, &buffer[..], true).unwrap();
1571 bufman.close_cursor(cursor).unwrap();
1572 written_at == 0
1573 }
1574
1575 // Prop test for `write_with_cursor` to check that all regions
1576 // that are written to are dirty

Callers

nothing calls this directly

Calls 4

create_tmp_file_of_sizeFunction · 0.85
open_cursorMethod · 0.80
write_with_cursorMethod · 0.80
close_cursorMethod · 0.80

Tested by

no test coverage detected