Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed May 31, 2022
1 parent 2d8a69c commit 5665071
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions arrow/src/array/array_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal_append_error_value() {
let mut decimal_builder = DecimalBuilder::new(10, 5, 3);
let mut result = decimal_builder.append_value(123456);
Expand Down
4 changes: 2 additions & 2 deletions arrow/src/array/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3417,14 +3417,14 @@ mod tests {

#[test]
fn test_decimal_builder() {
let mut builder = DecimalBuilder::new(30, 23, 6);
let mut builder = DecimalBuilder::new(30, 38, 6);

builder.append_value(8_887_000_000).unwrap();
builder.append_null().unwrap();
builder.append_value(-8_887_000_000).unwrap();
let decimal_array: DecimalArray = builder.finish();

assert_eq!(&DataType::Decimal(23, 6), decimal_array.data_type());
assert_eq!(&DataType::Decimal(38, 6), decimal_array.data_type());
assert_eq!(3, decimal_array.len());
assert_eq!(1, decimal_array.null_count());
assert_eq!(32, decimal_array.value_offset(2));
Expand Down
1 change: 1 addition & 0 deletions arrow/src/array/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal_full_validation() {
let values_builder = UInt8Builder::new(10);
let byte_width = 16;
Expand Down
3 changes: 3 additions & 0 deletions arrow/src/array/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal() {
let decimal_array =
create_decimal_array(&[Some(1), Some(2), None, Some(3)], 10, 3);
Expand All @@ -734,6 +735,7 @@ mod tests {
assert_eq!(array, expected);
}
#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal_offset() {
let decimal_array =
create_decimal_array(&[Some(1), Some(2), None, Some(3)], 10, 3);
Expand All @@ -748,6 +750,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal_null_offset_nulls() {
let decimal_array =
create_decimal_array(&[Some(1), Some(2), None, Some(3)], 10, 3);
Expand Down
4 changes: 2 additions & 2 deletions arrow/src/csv/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,8 @@ mod tests {
fn test_csv_reader_with_decimal() {
let schema = Schema::new(vec![
Field::new("city", DataType::Utf8, false),
Field::new("lat", DataType::Decimal(26, 6), false),
Field::new("lng", DataType::Decimal(26, 6), false),
Field::new("lat", DataType::Decimal(38, 6), false),
Field::new("lng", DataType::Decimal(38, 6), false),
]);

let file = File::open("test/data/decimal_test.csv").unwrap();
Expand Down
1 change: 1 addition & 0 deletions arrow/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn test_decimal_round_trip() -> Result<()> {
// create an array natively
let original_array = [Some(12345_i128), Some(-12345_i128), None]
Expand Down
2 changes: 2 additions & 0 deletions arrow/src/ipc/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ mod tests {
use crate::{datatypes, util::integration_util::*};

#[test]
#[cfg(not(feature = "force_validate"))]
fn read_generated_files_014() {
let testdata = crate::util::test_util::arrow_test_data();
let version = "0.14.1";
Expand Down Expand Up @@ -1156,6 +1157,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn read_generated_streams_014() {
let testdata = crate::util::test_util::arrow_test_data();
let version = "0.14.1";
Expand Down
2 changes: 2 additions & 0 deletions arrow/src/ipc/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn read_and_rewrite_generated_files_014() {
let testdata = crate::util::test_util::arrow_test_data();
let version = "0.14.1";
Expand Down Expand Up @@ -1130,6 +1131,7 @@ mod tests {
}

#[test]
#[cfg(not(feature = "force_validate"))]
fn read_and_rewrite_generated_streams_014() {
let testdata = crate::util::test_util::arrow_test_data();
let version = "0.14.1";
Expand Down

0 comments on commit 5665071

Please sign in to comment.