MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_bool_array_and_nulls_offset

Function test_bool_array_and_nulls_offset

arrow-arith/src/boolean.rs:736–758  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

734
735 #[test]
736 fn test_bool_array_and_nulls_offset() {
737 let a = BooleanArray::from(vec![None, Some(false), Some(true), None, Some(true)]);
738 let a = a.slice(1, 4);
739 let a = a.as_any().downcast_ref::<BooleanArray>().unwrap();
740
741 let b = BooleanArray::from(vec![
742 None,
743 None,
744 Some(true),
745 Some(false),
746 Some(true),
747 Some(true),
748 ]);
749
750 let b = b.slice(2, 4);
751 let b = b.as_any().downcast_ref::<BooleanArray>().unwrap();
752
753 let c = and(a, b).unwrap();
754
755 let expected = BooleanArray::from(vec![Some(false), Some(false), None, Some(true)]);
756
757 assert_eq!(expected, c);
758 }
759
760 #[test]
761 fn test_nonnull_array_is_null() {

Callers

nothing calls this directly

Calls 3

andFunction · 0.85
sliceMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected