()
| 754 | } |
| 755 | |
| 756 | fn test_generic_string<Offset: OffsetSizeTrait>() -> Result<()> { |
| 757 | // create an array natively |
| 758 | let array = GenericStringArray::<Offset>::from(vec![Some("a"), None, Some("aaa")]); |
| 759 | |
| 760 | // export it |
| 761 | let (array, schema) = to_ffi(&array.to_data())?; |
| 762 | |
| 763 | // (simulate consumer) import it |
| 764 | let data = unsafe { from_ffi(array, &schema) }?; |
| 765 | let array = make_array(data); |
| 766 | |
| 767 | // perform some operation |
| 768 | let array = array |
| 769 | .as_any() |
| 770 | .downcast_ref::<GenericStringArray<Offset>>() |
| 771 | .unwrap(); |
| 772 | |
| 773 | // verify |
| 774 | let expected = GenericStringArray::<Offset>::from(vec![Some("a"), None, Some("aaa")]); |
| 775 | assert_eq!(array, &expected); |
| 776 | |
| 777 | // (drop/release) |
| 778 | Ok(()) |
| 779 | } |
| 780 | |
| 781 | #[test] |
| 782 | fn test_string() -> Result<()> { |
nothing calls this directly
no test coverage detected