Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 14, 2022
1 parent d24bae3 commit ee9ec37
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions arrow/src/array/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2600,4 +2600,21 @@ mod tests {

assert_eq!(&struct_array_slice, &cloned);
}

#[test]
fn test_into_buffers() {
let data_types = vec![
DataType::Union(vec![], UnionMode::Dense),
DataType::Union(vec![], UnionMode::Sparse),
];

for data_type in data_types {
let buffers = new_buffers(&data_type, 0);
let [buffer1, buffer2] = buffers;
let buffers = into_buffers(&data_type, buffer1, buffer2);

let layout = layout(&data_type);
assert_eq!(buffers.len(), layout.buffers.len());
}
}
}

0 comments on commit ee9ec37

Please sign in to comment.