Skip to content

Commit

Permalink
Test formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Oct 22, 2021
1 parent bb784b9 commit 0f00a01
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions arrow/src/compute/kernels/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2359,22 +2359,19 @@ mod tests {
);

let f32_expected = vec![
-9223372000000000000.0,
-2147483600.0,
-32768.0,
-128.0,
0.0,
255.0,
65535.0,
4294967300.0,
18446744000000000000.0,
"-9223372000000000000.0",
"-2147483600.0",
"-32768.0",
"-128.0",
"0.0",
"255.0",
"65535.0",
"4294967300.0",
"18446744000000000000.0",
];
assert_eq!(
f32_expected,
get_cast_values::<Float32Type>(&f64_array, &DataType::Float32)
.iter()
.map(|i| i.parse::<f32>().unwrap())
.collect::<Vec<f32>>()
);

let i64_expected = vec![
Expand Down Expand Up @@ -2621,16 +2618,14 @@ mod tests {
];
let u64_array: ArrayRef = Arc::new(UInt64Array::from(u64_values));

let f64_expected = vec![
"0.0",
"255.0",
"65535.0",
"4294967295.0",
"18446744073709552000.0",
];
let f64_expected =
vec![0.0, 255.0, 65535.0, 4294967295.0, 18446744073709552000.0];
assert_eq!(
f64_expected,
get_cast_values::<Float64Type>(&u64_array, &DataType::Float64)
.iter()
.map(|i| i.parse::<f64>().unwrap())
.collect::<Vec<f64>>()
);

let f32_expected = vec![
Expand Down Expand Up @@ -2914,19 +2909,22 @@ mod tests {
let i64_array: ArrayRef = Arc::new(Int64Array::from(i64_values));

let f64_expected = vec![
"-9223372036854776000.0",
"-2147483648.0",
"-32768.0",
"-128.0",
"0.0",
"127.0",
"32767.0",
"2147483647.0",
"9223372036854776000.0",
-9223372036854776000.0,
-2147483648.0,
-32768.0,
-128.0,
0.0,
127.0,
32767.0,
2147483647.0,
9223372036854776000.0,
];
assert_eq!(
f64_expected,
get_cast_values::<Float64Type>(&i64_array, &DataType::Float64)
.iter()
.map(|i| i.parse::<f64>().unwrap())
.collect::<Vec<f64>>()
);

let f32_expected = vec![
Expand Down

0 comments on commit 0f00a01

Please sign in to comment.