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

Function test_validate_offsets_range_too_large

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

Source from the content-addressed store, hash-verified

275#[test]
276#[should_panic(expected = "Last offset 10 of Utf8 is larger than values length 6")]
277fn test_validate_offsets_range_too_large() {
278 let data_buffer = Buffer::from_slice_ref("abcdef".as_bytes());
279 // 10 is off the end of the buffer
280 let offsets_buffer = Buffer::from_slice_ref([0i32, 2i32, 10i32]);
281 ArrayData::try_new(
282 DataType::Utf8,
283 2,
284 None,
285 0,
286 vec![offsets_buffer, data_buffer],
287 vec![],
288 )
289 .unwrap();
290}
291
292#[test]
293#[should_panic(expected = "First 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