From 13362f7f5e00c865a01907f9f6cb3f4f4fe27004 Mon Sep 17 00:00:00 2001 From: kysshsy Date: Fri, 4 Oct 2024 19:28:44 +0800 Subject: [PATCH] fix: fix test fixture --- tests/fixtures/arrow.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/arrow.rs b/tests/fixtures/arrow.rs index fc88e50b..37588d6c 100644 --- a/tests/fixtures/arrow.rs +++ b/tests/fixtures/arrow.rs @@ -44,9 +44,12 @@ fn array_data() -> ArrayData { } fn single_array_data() -> ArrayData { + let values: [u8; 5] = *b"hello"; + let offsets: [i32; 2] = [0, 5]; ArrayData::builder(DataType::Binary) .len(1) - .add_buffer(Buffer::from("hello")) + .add_buffer(Buffer::from_slice_ref(&offsets[..])) + .add_buffer(Buffer::from_slice_ref(&values[..])) .build() .unwrap() } @@ -75,9 +78,12 @@ fn binary_array_data() -> ArrayData { } fn single_binary_array_data() -> ArrayData { + let values: [u8; 5] = *b"hello"; + let offsets: [i32; 2] = [0, 5]; ArrayData::builder(DataType::Binary) .len(1) - .add_buffer(Buffer::from("hello")) + .add_buffer(Buffer::from_slice_ref(&offsets[..])) + .add_buffer(Buffer::from_slice_ref(&values[..])) .build() .unwrap() }