MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_array_wrong_cardinality

Function test_array_wrong_cardinality

src/repr/src/row.rs:3841–3864  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3839
3840 #[mz_ore::test]
3841 fn test_array_wrong_cardinality() {
3842 let mut row = Row::default();
3843 let res = row.packer().try_push_array(
3844 &[
3845 ArrayDimension {
3846 lower_bound: 1,
3847 length: 2,
3848 },
3849 ArrayDimension {
3850 lower_bound: 1,
3851 length: 3,
3852 },
3853 ],
3854 vec![Datum::Int32(1), Datum::Int32(2)],
3855 );
3856 assert_eq!(
3857 res,
3858 Err(InvalidArrayError::WrongCardinality {
3859 actual: 2,
3860 expected: 6,
3861 })
3862 );
3863 assert!(row.data.is_empty());
3864 }
3865
3866 #[mz_ore::test]
3867 fn test_array_cardinality_overflow() {

Callers

nothing calls this directly

Calls 2

try_push_arrayMethod · 0.80
packerMethod · 0.80

Tested by

no test coverage detected