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

Function simple_arithmetic

nodedb-query/src/expr_parse/parser.rs:510–516  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

508
509 #[test]
510 fn simple_arithmetic() {
511 let (expr, deps) = parse_ok("price * (1 + tax_rate)");
512 assert_eq!(deps, vec!["price", "tax_rate"]);
513 let doc = Value::from(serde_json::json!({"price": 100.0, "tax_rate": 0.08}));
514 let result = expr.eval(&doc);
515 assert_eq!(result.as_f64(), Some(108.0));
516 }
517
518 #[test]
519 fn round_function() {

Callers

nothing calls this directly

Calls 2

evalMethod · 0.80
parse_okFunction · 0.70

Tested by

no test coverage detected