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

Function test_validate_offsets_first_too_large

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

Source from the content-addressed store, hash-verified

292#[test]
293#[should_panic(expected = "First offset 10 of Utf8 is larger than values length 6")]
294fn test_validate_offsets_first_too_large() {
295 let data_buffer = Buffer::from_slice_ref("abcdef".as_bytes());
296 // 10 is off the end of the buffer
297 let offsets_buffer = Buffer::from_slice_ref([10i32, 2i32, 10i32]);
298 ArrayData::try_new(
299 DataType::Utf8,
300 2,
301 None,
302 0,
303 vec![offsets_buffer, data_buffer],
304 vec![],
305 )
306 .unwrap();
307}
308
309#[test]
310fn test_validate_offsets_first_too_large_skipped() {

Callers

nothing calls this directly

Calls 2

try_newFunction · 0.85
as_bytesMethod · 0.45

Tested by

no test coverage detected