MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_single_empty_segment

Function test_single_empty_segment

src/ore/src/bytes.rs:633–648  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

631
632 #[crate::test]
633 fn test_single_empty_segment() {
634 let s = SegmentedBytes::from(Vec::<u8>::new());
635
636 // Everything should comeback empty.
637 assert_eq!(s.len(), 0);
638 assert_eq!(s.remaining(), 0);
639 assert!(s.chunk().is_empty());
640
641 let mut reader = s.reader();
642
643 // Reading shouldn't fail, but it also shouldn't yield any bytes.
644 let mut buf = [0; 4];
645 let bytes_read = reader.read(&mut buf).unwrap();
646 assert_eq!(bytes_read, 0);
647 assert_eq!(buf, [0, 0, 0, 0]);
648 }
649
650 #[crate::test]
651 fn test_middle_segment_empty() {

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.80
readerMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected