mod cast;
mod compare;
mod fill_null;
pub(crate) mod filter;
pub(crate) mod is_constant;
pub(crate) mod is_sorted;
pub(crate) mod min_max;
pub(crate) mod take;
pub(crate) mod take_from;
#[cfg(test)]
mod tests {
use std::sync::LazyLock;
use rstest::rstest;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::compute::conformance::consistency::test_array_consistency;
use vortex_buffer::buffer;
use vortex_session::VortexSession;
use crate::RunEnd;
use crate::RunEndArray;
static SESSION: LazyLock<VortexSession> = LazyLock::new(|| {
let session = vortex_array::array_session();
crate::initialize(&session);
session
});
#[rstest]
#[case::runend_i32(RunEnd::encode(
buffer![1i32, 1, 1, 2, 2, 3, 3, 3, 3].into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
#[case::runend_single_run(RunEnd::encode(
buffer![5i32, 5, 5, 5, 5].into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
#[case::runend_alternating(RunEnd::encode(
buffer![1i32, 2, 1, 2, 1, 2].into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
#[case::runend_u64(RunEnd::encode(
buffer![100u64, 100, 200, 200, 200].into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
#[case::runend_single(RunEnd::encode(
buffer![42i32].into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
#[case::runend_large(RunEnd::encode(
PrimitiveArray::from_iter((0..1000).map(|i| i / 10)).into_array(),
&mut SESSION.create_execution_ctx(),
).unwrap())]
fn test_runend_consistency(#[case] array: RunEndArray) {
test_array_consistency(&array.into_array(), &mut SESSION.create_execution_ctx());
}
}