vortex_array/compute/arbitrary.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4use arbitrary::Arbitrary;
5use arbitrary::Unstructured;
6
7use crate::compute::Operator;
8
9impl<'a> Arbitrary<'a> for Operator {
10 fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
11 Ok(match u.int_in_range(0..=5)? {
12 0 => Operator::Eq,
13 1 => Operator::NotEq,
14 2 => Operator::Gt,
15 3 => Operator::Gte,
16 4 => Operator::Lt,
17 5 => Operator::Lte,
18 _ => unreachable!(),
19 })
20 }
21}