MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_simple_equality

Function parse_simple_equality

nodedb/src/control/security/predicate.rs:373–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371
372 #[test]
373 fn parse_simple_equality() {
374 let pred = parse_predicate("user_id = $auth.id").unwrap();
375 match pred {
376 RlsPredicate::Compare { field, op, value } => {
377 assert_eq!(field, "user_id");
378 assert_eq!(op, CompareOp::Eq);
379 assert!(matches!(value, PredicateValue::AuthRef(ref f) if f == "id"));
380 }
381 _ => panic!("expected Compare"),
382 }
383 }
384
385 #[test]
386 fn parse_and_or() {

Callers

nothing calls this directly

Calls 1

parse_predicateFunction · 0.85

Tested by

no test coverage detected