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

Commit

Permalink
add test case for no null
Browse files Browse the repository at this point in the history
Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 committed May 22, 2022
1 parent 1965fa6 commit 6cb4994
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/it/compute/aggregate/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ fn min_max_f64_edge_cases() {
assert_eq!(Some(f64::INFINITY), max_primitive(&a));
}

// todo: convert me
#[test]
fn test_string_min_max_with_nulls() {
let a = Utf8Array::<i32>::from(&[Some("b"), None, None, Some("a"), Some("c")]);
assert_eq!("a", min_string(&a).unwrap());
assert_eq!("c", max_string(&a).unwrap());
assert_eq!(Some("a"), min_string(&a));
assert_eq!(Some("c"), max_string(&a));
}

#[test]
Expand All @@ -127,6 +126,13 @@ fn test_string_min_max_all_nulls() {
assert_eq!(None, max_string(&a));
}

#[test]
fn test_string_min_max_no_null() {
let a = Utf8Array::<i32>::from(&[Some("abc"), Some("abd"), Some("bac"), Some("bbb")]);
assert_eq!(Some("abc"), min_string(&a));
assert_eq!(Some("bbb"), max_string(&a));
}

#[test]
fn test_string_min_max_1() {
let a = Utf8Array::<i32>::from(&[None, None, Some("b"), Some("a")]);
Expand Down

0 comments on commit 6cb4994

Please sign in to comment.