()
| 3284 | |
| 3285 | #[test] |
| 3286 | fn test_validation_of_invalid_string_array() { |
| 3287 | let valid: &[u8] = b" "; |
| 3288 | let mut invalid = vec![]; |
| 3289 | invalid.extend_from_slice(b"ThisStringIsCertainlyLongerThan12Bytes"); |
| 3290 | invalid.extend_from_slice(INVALID_UTF8_FIRST_CHAR); |
| 3291 | let binary_array = BinaryArray::from_iter(vec![None, Some(valid), None, Some(&invalid)]); |
| 3292 | // data is not valid utf8 we can not construct a correct StringArray |
| 3293 | // safely, so purposely create an invalid StringArray |
| 3294 | let array = unsafe { |
| 3295 | StringArray::new_unchecked( |
| 3296 | binary_array.offsets().clone(), |
| 3297 | binary_array.values().clone(), |
| 3298 | binary_array.nulls().cloned(), |
| 3299 | ) |
| 3300 | }; |
| 3301 | expect_ipc_validation_error( |
| 3302 | Arc::new(array), |
| 3303 | "Invalid argument error: Invalid UTF8 sequence at string index 3 (3..45): invalid utf-8 sequence of 1 bytes from index 38", |
| 3304 | ); |
| 3305 | } |
| 3306 | |
| 3307 | #[test] |
| 3308 | fn test_validation_of_invalid_string_view_array() { |
nothing calls this directly
no test coverage detected