MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / test_timestamp_variable

Function test_timestamp_variable

cel/src/functions.rs:770–781  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

768 #[cfg(feature = "chrono")]
769 #[test]
770 fn test_timestamp_variable() {
771 let mut context = Context::default();
772 let ts: chrono::DateTime<chrono::FixedOffset> =
773 chrono::DateTime::parse_from_rfc3339("2023-05-29T00:00:00Z").unwrap();
774 context
775 .add_variable("ts", crate::Value::Timestamp(ts))
776 .unwrap();
777
778 let program = crate::Program::compile("ts == timestamp('2023-05-29T00:00:00Z')").unwrap();
779 let result = program.execute(&context).unwrap();
780 assert_eq!(result, true.into());
781 }
782
783 #[cfg(feature = "chrono")]
784 #[test]

Callers

nothing calls this directly

Calls 3

add_variableMethod · 0.80
executeMethod · 0.80
TimestampClass · 0.70

Tested by

no test coverage detected