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

Function test_validate_offsets_negative_first_i32

arrow/tests/array_validation.rs:228–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226#[test]
227#[should_panic(expected = "Error converting offset[0] (-2) to usize for Utf8")]
228fn test_validate_offsets_negative_first_i32() {
229 let data_buffer = Buffer::from_slice_ref("abcdef".as_bytes());
230 let offsets_buffer = Buffer::from_slice_ref([-2i32, 1i32, 3i32]);
231 ArrayData::try_new(
232 DataType::Utf8,
233 2,
234 None,
235 0,
236 vec![offsets_buffer, data_buffer],
237 vec![],
238 )
239 .unwrap();
240}
241
242#[test]
243#[should_panic(expected = "Error converting offset[2] (-3) to usize for Utf8")]

Callers

nothing calls this directly

Calls 2

try_newFunction · 0.85
as_bytesMethod · 0.45

Tested by

no test coverage detected