()
| 1406 | /// 2) All inline values (<= INLINE_LEN): capacity-only data buffer, same values |
| 1407 | #[test] |
| 1408 | fn test_gc_all_inline() { |
| 1409 | let mut builder = StringViewBuilder::new().with_fixed_block_size(BLOCK_SIZE); |
| 1410 | // append many short strings, each exactly INLINE_LEN long |
| 1411 | for _ in 0..100 { |
| 1412 | let s = "A".repeat(MAX_INLINE_VIEW_LEN as usize); |
| 1413 | builder.append_option(Some(&s)); |
| 1414 | } |
| 1415 | let array = builder.finish(); |
| 1416 | let gced = array.gc(); |
| 1417 | // Since all views fit inline, data buffer is empty |
| 1418 | assert_eq!( |
| 1419 | gced.data_buffers().len(), |
| 1420 | 0, |
| 1421 | "Should have no data buffers for inline values" |
| 1422 | ); |
| 1423 | assert_eq!(gced.len(), 100); |
| 1424 | // verify element-wise equality |
| 1425 | array.iter().zip(gced.iter()).for_each(|(orig, got)| { |
| 1426 | assert_eq!(orig, got, "Inline value mismatch after gc"); |
| 1427 | }); |
| 1428 | } |
| 1429 | |
| 1430 | /// 3) All large values (> INLINE_LEN): each must be copied into the new data buffer |
| 1431 | #[test] |
nothing calls this directly
no test coverage detected