Skip to content

Commit

Permalink
follow reviews
Browse files Browse the repository at this point in the history
Signed-off-by: fan <[email protected]>
  • Loading branch information
fansehep committed Oct 18, 2023
1 parent d45b5bc commit 3b5a198
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions parquet/src/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2299,29 +2299,17 @@ mod tests {
assert_eq!(compress, Compression::LZ4);

// test unknown compression
match "unknown".parse::<Compression>() {
Ok(c) => {
panic!("Should not be able to parse {:?}", c);
}
Err(e) => {
assert_eq!(
e.to_string(),
"Parquet error: unsupport compression UNKNOWN"
);
}
}
let mut err = "plain_xxx".parse::<Encoding>().unwrap_err();
assert_eq!(
err.to_string(),
"Parquet error: unknown encoding: plain_xxx"
);

// test invalid compress level
match "gziP(-10)".parse::<Compression>() {
Ok(c) => {
panic!("Should not be able to parse {:?}", c);
}
Err(e) => {
assert_eq!(
e.to_string(),
"Parquet error: invalid compression level: -10)"
);
}
}
err = "gzip(-10)".parse::<Encoding>().unwrap_err();
assert_eq!(
err.to_string(),
"Parquet error: unknown encoding: gzip(-10)"
);
}
}

0 comments on commit 3b5a198

Please sign in to comment.