Skip to content

Commit

Permalink
test: replace assert!(<actual> == <real>) by assert_eq!(<actual>, <re…
Browse files Browse the repository at this point in the history
…al>) in some tests
  • Loading branch information
hussein-awala committed Jan 23, 2025
1 parent efca9f0 commit 1aa2f4e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/iceberg/src/arrow/record_batch_projector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ mod test {
RecordBatchProjector::new(schema.clone(), &[1, 3], field_id_fetch_func, |_| true)
.unwrap();

assert!(projector.field_indices.len() == 2);
assert_eq!(projector.field_indices.len(), 2);
assert_eq!(projector.field_indices[0], vec![0]);
assert_eq!(projector.field_indices[1], vec![0, 1]);

Expand Down
20 changes: 10 additions & 10 deletions crates/iceberg/src/spec/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2691,21 +2691,21 @@ mod tests {
}
let res = writer.write_manifest_file().await.unwrap();

assert!(res.partitions.len() == 3);
assert!(res.partitions[0].lower_bound == Some(Datum::int(1111)));
assert!(res.partitions[0].upper_bound == Some(Datum::int(2021)));
assert_eq!(res.partitions.len(), 3);
assert_eq!(res.partitions[0].lower_bound, Some(Datum::int(1111)));
assert_eq!(res.partitions[0].upper_bound, Some(Datum::int(2021)));
assert!(!res.partitions[0].contains_null);
assert!(res.partitions[0].contains_nan == Some(false));
assert_eq!(res.partitions[0].contains_nan, Some(false));

assert!(res.partitions[1].lower_bound == Some(Datum::float(1.0)));
assert!(res.partitions[1].upper_bound == Some(Datum::float(15.5)));
assert_eq!(res.partitions[1].lower_bound, Some(Datum::float(1.0)));
assert_eq!(res.partitions[1].upper_bound, Some(Datum::float(15.5)));
assert!(res.partitions[1].contains_null);
assert!(res.partitions[1].contains_nan == Some(true));
assert_eq!(res.partitions[1].contains_nan, Some(true));

assert!(res.partitions[2].lower_bound == Some(Datum::double(1.0)));
assert!(res.partitions[2].upper_bound == Some(Datum::double(25.5)));
assert_eq!(res.partitions[2].lower_bound, Some(Datum::double(1.0)));
assert_eq!(res.partitions[2].upper_bound, Some(Datum::double(25.5)));
assert!(!res.partitions[2].contains_null);
assert!(res.partitions[2].contains_nan == Some(false));
assert_eq!(res.partitions[2].contains_nan, Some(false));
}

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion crates/integration_tests/tests/scan_all_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async fn test_scan_all_type() {
.into_iter(),
)
.unwrap();
assert!(col12.data_type() == &DataType::FixedSizeBinary(10));
assert_eq!(col12.data_type(), &DataType::FixedSizeBinary(10));
let col13 = FixedSizeBinaryArray::try_from_iter(
vec![
Uuid::new_v4().as_bytes().to_vec(),
Expand Down

0 comments on commit 1aa2f4e

Please sign in to comment.