()
| 265 | |
| 266 | #[test] |
| 267 | fn array_remove_function() { |
| 268 | let expr = nodedb_query::expr_parse::parse_generated_expr("array_remove(tags, 'b')") |
| 269 | .unwrap() |
| 270 | .0; |
| 271 | let doc = nodedb_types::Value::from(serde_json::json!({"tags": ["a", "b", "c"]})); |
| 272 | assert_eq!( |
| 273 | expr.eval(&doc), |
| 274 | nodedb_types::Value::Array(vec![ |
| 275 | nodedb_types::Value::String("a".into()), |
| 276 | nodedb_types::Value::String("c".into()), |
| 277 | ]) |
| 278 | ); |
| 279 | } |
| 280 | |
| 281 | #[test] |
| 282 | fn no_match_returns_zero() { |
nothing calls this directly
no test coverage detected