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

Commit

Permalink
add test to cover the no null case for binary
Browse files Browse the repository at this point in the history
Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 committed May 23, 2022
1 parent ba6c04a commit c2332f1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/it/compute/aggregate/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,20 @@ fn test_boolean_min_max_smaller() {
#[test]
fn test_binary_min_max_with_nulls() {
let a = BinaryArray::<i32>::from(&[Some(b"b"), None, None, Some(b"a"), Some(b"c")]);
assert_eq!("a".as_bytes(), min_binary(&a).unwrap());
assert_eq!("c".as_bytes(), max_binary(&a).unwrap());
assert_eq!(Some("a".as_bytes()), min_binary(&a));
assert_eq!(Some("c".as_bytes()), max_binary(&a));
}

#[test]
fn test_binary_min_max_no_null() {
let a = BinaryArray::<i32>::from(&[
Some("abc".as_bytes()),
Some(b"acd"),
Some(b"aabd"),
Some(b""),
]);
assert_eq!(Some("".as_bytes()), min_binary(&a));
assert_eq!(Some("acd".as_bytes()), max_binary(&a));
}

#[test]
Expand Down

0 comments on commit c2332f1

Please sign in to comment.