MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / test_now_function

Function test_now_function

graphlite/src/functions/temporal_functions.rs:1322–1344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1320
1321 #[test]
1322 fn test_now_function() {
1323 let now_func = NowFunction::new();
1324
1325 // Test NOW with no arguments
1326 let context = FunctionContext::new(vec![], HashMap::new(), vec![]);
1327 let result = now_func.execute(&context);
1328 assert!(result.is_ok());
1329
1330 if let Ok(Value::DateTime(_)) = result {
1331 // Success - we got a datetime
1332 } else {
1333 panic!("Expected DateTime value from NOW()");
1334 }
1335
1336 // Test NOW with arguments (should fail)
1337 let context_with_args = FunctionContext::new(
1338 vec![],
1339 HashMap::new(),
1340 vec![Value::String("invalid".to_string())],
1341 );
1342 let result = now_func.execute(&context_with_args);
1343 assert!(result.is_err());
1344 }
1345
1346 #[test]
1347 fn test_duration_function() {

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected