|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2022, The Cozo Project Authors. Licensed under AGPL-3 or later.
|
|
|
|
|
* Copyright 2022, The Cozo Project Authors. Licensed under MPL-2.0.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
use approx::AbsDiffEq;
|
|
|
|
@ -245,7 +245,7 @@ fn test_comparators() {
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_max_min() {
|
|
|
|
|
assert_eq!(op_max(&[DataValue::from(1), ]).unwrap(), DataValue::from(1));
|
|
|
|
|
assert_eq!(op_max(&[DataValue::from(1),]).unwrap(), DataValue::from(1));
|
|
|
|
|
assert_eq!(
|
|
|
|
|
op_max(&[
|
|
|
|
|
DataValue::from(1),
|
|
|
|
@ -278,7 +278,7 @@ fn test_max_min() {
|
|
|
|
|
);
|
|
|
|
|
assert!(op_max(&[DataValue::Bool(true)]).is_err());
|
|
|
|
|
|
|
|
|
|
assert_eq!(op_min(&[DataValue::from(1), ]).unwrap(), DataValue::from(1));
|
|
|
|
|
assert_eq!(op_min(&[DataValue::from(1),]).unwrap(), DataValue::from(1));
|
|
|
|
|
assert_eq!(
|
|
|
|
|
op_min(&[
|
|
|
|
|
DataValue::from(1),
|
|
|
|
@ -1325,7 +1325,10 @@ fn test_uuid() {
|
|
|
|
|
assert!(op_is_uuid(&[v4]).unwrap().get_bool().unwrap());
|
|
|
|
|
assert!(op_uuid_timestamp(&[v1]).unwrap().get_float().is_some());
|
|
|
|
|
assert!(op_to_uuid(&[DataValue::Str(SmartString::from(""))]).is_err());
|
|
|
|
|
assert!(op_to_uuid(&[DataValue::Str(SmartString::from("f3b4958c-52a1-11e7-802a-010203040506"))]).is_ok());
|
|
|
|
|
assert!(op_to_uuid(&[DataValue::Str(SmartString::from(
|
|
|
|
|
"f3b4958c-52a1-11e7-802a-010203040506"
|
|
|
|
|
))])
|
|
|
|
|
.is_ok());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
@ -1335,3 +1338,8 @@ fn test_now() {
|
|
|
|
|
let s = op_format_timestamp(&[now]).unwrap();
|
|
|
|
|
let _dt = op_parse_timestamp(&[s]).unwrap();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_to_bool() {
|
|
|
|
|
todo!()
|
|
|
|
|
}
|
|
|
|
|