use arrow2::{ datatypes::DataType, scalar::{BinaryScalar, Scalar}, }; #[allow(clippy::eq_op)] #[test] fn equal() { let a = BinaryScalar::::from(Some("a")); let b = BinaryScalar::::from(None::<&str>); assert_eq!(a, a); assert_eq!(b, b); assert!(a != b); let b = BinaryScalar::::from(Some("b")); assert!(a != b); assert_eq!(b, b); } #[test] fn basics() { let a = BinaryScalar::::from(Some("a")); assert_eq!(a.value(), Some(b"a".as_ref())); assert_eq!(a.data_type(), &DataType::Binary); assert!(a.is_valid()); let a = BinaryScalar::::from(None::<&str>); assert_eq!(a.data_type(), &DataType::LargeBinary); assert!(!a.is_valid()); let _: &dyn std::any::Any = a.as_any(); }