Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve committed Jun 23, 2024
1 parent 644355c commit c95231c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod tests {
}

#[test]
fn fails_for_bad_size() -> Result<(), ParquetError> {
fn fails_for_invalid_values_size() -> Result<(), ParquetError> {
let buffer = vec![0; 12];

let result = Decoder::try_new(&buffer, 8);
Expand All @@ -50,6 +50,16 @@ mod tests {
Ok(())
}

#[test]
fn fails_for_invalid_element_size() -> Result<(), ParquetError> {
let buffer = vec![0; 16];

let result = Decoder::try_new(&buffer, 16);
assert!(result.is_err());

Ok(())
}

fn encode<T: NativeType>(data: &[T], buffer: &mut Vec<u8>) {
let element_size = std::mem::size_of::<T>();
let num_elements = data.len();
Expand Down

0 comments on commit c95231c

Please sign in to comment.