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

Function test_range_errors_inner

src/repr/src/row.rs:4029–4059  ·  view source on GitHub ↗
(
            datums: Vec<Vec<Datum<'a>>>,
        )

Source from the content-addressed store, hash-verified

4027 #[mz_ore::test]
4028 fn test_range_errors() {
4029 fn test_range_errors_inner<'a>(
4030 datums: Vec<Vec<Datum<'a>>>,
4031 ) -> Result<(), InvalidRangeError> {
4032 let mut row = Row::default();
4033 let row_len = row.byte_len();
4034 let mut packer = row.packer();
4035 let r = packer.push_range_with(
4036 RangeLowerBound {
4037 inclusive: true,
4038 bound: Some(|row: &mut RowPacker| {
4039 for d in &datums[0] {
4040 row.push(d);
4041 }
4042 Ok(())
4043 }),
4044 },
4045 RangeUpperBound {
4046 inclusive: true,
4047 bound: Some(|row: &mut RowPacker| {
4048 for d in &datums[1] {
4049 row.push(d);
4050 }
4051 Ok(())
4052 }),
4053 },
4054 );
4055
4056 assert_eq!(row_len, row.byte_len());
4057
4058 r
4059 }
4060
4061 // A finite bound whose closure pushes zero values violates the
4062 // `push_range_with` caller contract and still panics. This is

Callers 1

test_range_errorsFunction · 0.85

Calls 4

packerMethod · 0.80
push_range_withMethod · 0.80
byte_lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected