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

Function non_utf8_bytes

arrow-string/src/substring.rs:984–994  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

982
983 #[test]
984 fn non_utf8_bytes() {
985 // non-utf8 bytes
986 let bytes: &[u8] = &[0xE4, 0xBD, 0xA0, 0xE5, 0xA5, 0xBD, 0xE8, 0xAF, 0xAD];
987 let array = BinaryArray::from(vec![Some(bytes)]);
988 let arr = substring(&array, 0, Some(5)).unwrap();
989 let actual = arr.as_any().downcast_ref::<BinaryArray>().unwrap();
990
991 let expected_bytes: &[u8] = &[0xE4, 0xBD, 0xA0, 0xE5, 0xA5];
992 let expected = BinaryArray::from(vec![Some(expected_bytes)]);
993 assert_eq!(expected, *actual);
994 }
995}

Callers

nothing calls this directly

Calls 2

substringFunction · 0.70
as_anyMethod · 0.45

Tested by

no test coverage detected