Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Jul 26, 2024
1 parent ba2a2f1 commit 6bdbb72
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions datafusion/functions/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ pub mod test {
};
}

use arrow::datatypes::DataType;
#[allow(unused_imports)]
pub(crate) use test_function;

use super::*;

#[test]
fn string_to_int_type() {
let v = utf8_to_int_type(&DataType::Utf8, "test").unwrap();
assert_eq!(v, DataType::Int32);

let v = utf8_to_int_type(&DataType::Utf8View, "test").unwrap();
assert_eq!(v, DataType::Int32);

let v = utf8_to_int_type(&DataType::LargeUtf8, "test").unwrap();
assert_eq!(v, DataType::Int64);
}
}

0 comments on commit 6bdbb72

Please sign in to comment.