2025-12-23 18:41:29 -03:00
|
|
|
|
|
|
|
|
|
2025-12-23 15:52:52 -03:00
|
|
|
|
|
|
|
|
#![allow(unused_imports)]
|
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
#![allow(dead_code)]
|
2025-12-23 18:41:29 -03:00
|
|
|
|
2025-12-23 15:52:52 -03:00
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
2025-12-23 18:41:29 -03:00
|
|
|
|
2025-12-23 15:52:52 -03:00
|
|
|
fn test_clean_value_for_type() {
|
|
|
|
|
assert_eq!(clean_value_for_type(&json!("test"), "text"), json!("test"));
|
|
|
|
|
assert_eq!(clean_value_for_type(&json!("42"), "integer"), json!(42));
|
|
|
|
|
assert_eq!(clean_value_for_type(&json!("3.14"), "numeric"), json!(3.14));
|
|
|
|
|
assert_eq!(clean_value_for_type(&json!("true"), "boolean"), json!(true));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
2025-12-23 18:41:29 -03:00
|
|
|
|
2025-12-23 15:52:52 -03:00
|
|
|
fn test_get_default_schema() {
|
|
|
|
|
let leads_schema = get_default_schema("leads");
|
|
|
|
|
assert!(leads_schema.is_array());
|
|
|
|
|
|
|
|
|
|
let tasks_schema = get_default_schema("tasks");
|
|
|
|
|
assert!(tasks_schema.is_array());
|
|
|
|
|
}
|