MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_basic

Function test_basic

arrow-buffer/src/builder/offset.rs:94–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93 #[test]
94 fn test_basic() {
95 let mut builder = OffsetBufferBuilder::<i32>::new(5);
96 assert_eq!(builder.len(), 1);
97 assert_eq!(&*builder, &[0]);
98 let finished = builder.finish_cloned();
99 assert_eq!(finished.len(), 1);
100 assert_eq!(&*finished, &[0]);
101
102 builder.push_length(2);
103 builder.push_length(6);
104 builder.push_length(0);
105 builder.push_length(13);
106
107 let finished = builder.finish();
108 assert_eq!(&*finished, &[0, 2, 8, 8, 21]);
109 }
110
111 #[test]
112 #[should_panic(expected = "overflow")]

Callers

nothing calls this directly

Calls 3

push_lengthMethod · 0.80
finish_clonedMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected