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

Function test_validate_offsets_range_too_small

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

Source from the content-addressed store, hash-verified

258#[test]
259#[should_panic(expected = "First offset 4 in Utf8 is smaller than last offset 3")]
260fn test_validate_offsets_range_too_small() {
261 let data_buffer = Buffer::from_slice_ref("abcdef".as_bytes());
262 // start offset is larger than end
263 let offsets_buffer = Buffer::from_slice_ref([4i32, 2i32, 3i32]);
264 ArrayData::try_new(
265 DataType::Utf8,
266 2,
267 None,
268 0,
269 vec![offsets_buffer, data_buffer],
270 vec![],
271 )
272 .unwrap();
273}
274
275#[test]
276#[should_panic(expected = "Last offset 10 of Utf8 is larger than values length 6")]

Callers

nothing calls this directly

Calls 2

try_newFunction · 0.85
as_bytesMethod · 0.45

Tested by

no test coverage detected