()
| 249 | |
| 250 | #[test] |
| 251 | fn array_append_function() { |
| 252 | let expr = nodedb_query::expr_parse::parse_generated_expr("array_append(tags, 'new')") |
| 253 | .unwrap() |
| 254 | .0; |
| 255 | let doc = nodedb_types::Value::from(serde_json::json!({"tags": ["a", "b"]})); |
| 256 | assert_eq!( |
| 257 | expr.eval(&doc), |
| 258 | nodedb_types::Value::Array(vec![ |
| 259 | nodedb_types::Value::String("a".into()), |
| 260 | nodedb_types::Value::String("b".into()), |
| 261 | nodedb_types::Value::String("new".into()), |
| 262 | ]) |
| 263 | ); |
| 264 | } |
| 265 | |
| 266 | #[test] |
| 267 | fn array_remove_function() { |
nothing calls this directly
no test coverage detected