Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Solve remaining test mysteries
Browse files Browse the repository at this point in the history
  • Loading branch information
AnIrishDuck committed Oct 28, 2022
1 parent 5b3ef81 commit 06757db
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions tests/it/io/json/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ fn read_json_records() -> Result<()> {
let a_iter = a_iter.into_iter().map(Some);
let a_inner = MutableListArray::<i32, MutablePrimitiveArray<f64>>::new_with_field(
MutablePrimitiveArray::<f64>::new(),
"inner",
false,
"item",
true,
);
let mut a_outer =
MutableListArray::<i32, MutableListArray<i32, MutablePrimitiveArray<f64>>>::new_with_field(
a_inner, "a", false,
a_inner, "item", true,
);
a_outer.try_extend(a_iter).unwrap();
let a_expected: ListArray<i32> = a_outer.into();
Expand All @@ -90,8 +90,8 @@ fn read_json_records() -> Result<()> {
let b_iter = b_iter.into_iter().map(Some);
let mut b = MutableListArray::<i32, MutablePrimitiveArray<i64>>::new_with_field(
MutablePrimitiveArray::<i64>::new(),
"b",
false,
"item",
true,
);
b.try_extend(b_iter).unwrap();
let b_expected: ListArray<i32> = b.into();
Expand All @@ -110,8 +110,7 @@ fn read_json_records() -> Result<()> {
panic!("unexpected field found: {}", f.name);
};

// No idea why assert_eq! doesn't work here, but this does.
assert_eq!(format!("{:?}", expected), format!("{:?}", actual));
assert_eq!(expected.to_boxed().as_ref(), actual);
}

Ok(())
Expand Down Expand Up @@ -141,7 +140,7 @@ fn read_json_fixed_size_records() -> Result<()> {
let mut a = MutableFixedSizeListArray::<MutablePrimitiveArray<f64>>::new_with_field(
MutablePrimitiveArray::<f64>::new(),
"inner",
false,
true,
4,
);
a.try_extend(a_iter).unwrap();
Expand All @@ -159,8 +158,7 @@ fn read_json_fixed_size_records() -> Result<()> {
panic!("unexpected field found: {}", f.name);
};

// No idea why assert_eq! doesn't work here, but this does.
assert_eq!(format!("{:?}", expected), format!("{:?}", actual));
assert_eq!(expected.to_boxed().as_ref(), actual);
}

Ok(())
Expand Down

0 comments on commit 06757db

Please sign in to comment.