Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Oct 11, 2024
1 parent 3a035fc commit ed1a4b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arrow-cast/src/cast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8483,7 +8483,8 @@ mod tests {
assert!(decimal_arr.is_null(27));
assert_eq!("0.00", decimal_arr.value_as_string(28));
assert_eq!("0.00", decimal_arr.value_as_string(29));
assert_eq!(decimal_arr.len(), 30);
assert_eq!("12345.00", decimal_arr.value_as_string(30));
assert_eq!(decimal_arr.len(), 31);

// Decimal256
let output_type = DataType::Decimal256(76, 3);
Expand Down Expand Up @@ -8522,7 +8523,8 @@ mod tests {
assert!(decimal_arr.is_null(27));
assert_eq!("0.000", decimal_arr.value_as_string(28));
assert_eq!("0.000", decimal_arr.value_as_string(29));
assert_eq!(decimal_arr.len(), 30);
assert_eq!("12345.000", decimal_arr.value_as_string(30));
assert_eq!(decimal_arr.len(), 31);
}

#[test]
Expand Down Expand Up @@ -8558,6 +8560,7 @@ mod tests {
Some("--1.23499999"),
Some("0"),
Some("000.000"),
Some("0000000000000000012345.000"),
]);
let array = Arc::new(str_array) as ArrayRef;

Expand All @@ -8570,6 +8573,7 @@ mod tests {
(Some("0"), Some("0")),
(Some("000.000"), Some("0")),
(Some("12345"), Some("12345")),
(Some("000000000000000000000000000012345"), Some("12345")),
(Some("-123"), Some("-123")),
(Some("+123"), Some("123")),
];
Expand Down Expand Up @@ -8613,6 +8617,7 @@ mod tests {
Some("--1.23499999"),
Some("0"),
Some("000.000"),
Some("0000000000000000012345.000"),
]);
let array = Arc::new(str_array) as ArrayRef;

Expand All @@ -8625,6 +8630,7 @@ mod tests {
(Some("0"), Some("0")),
(Some("000.000"), Some("0")),
(Some("12345"), Some("12345")),
(Some("000000000000000000000000000012345"), Some("12345")),
(Some("-123"), Some("-123")),
(Some("+123"), Some("123")),
];
Expand Down

0 comments on commit ed1a4b8

Please sign in to comment.