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

Function seed

nodedb/tests/executor_tests/test_array_ops.rs:50–91  ·  view source on GitHub ↗
(
    core: &mut nodedb::data::executor::core_loop::CoreLoop,
    tx: &mut nodedb_bridge::buffer::Producer<nodedb::bridge::dispatch::BridgeRequest>,
    rx: &mut nodedb_bridge::buffer::Consumer<nodedb

Source from the content-addressed store, hash-verified

48}
49
50fn seed(
51 core: &mut nodedb::data::executor::core_loop::CoreLoop,
52 tx: &mut nodedb_bridge::buffer::Producer<nodedb::bridge::dispatch::BridgeRequest>,
53 rx: &mut nodedb_bridge::buffer::Consumer<nodedb::bridge::dispatch::BridgeResponse>,
54) {
55 insert_product(
56 core,
57 tx,
58 rx,
59 "p1",
60 serde_json::json!({
61 "name": "T-Shirt", "brand": "Nike", "tags": ["sale", "new"], "sizes": ["S", "M", "L"], "color": "red"
62 }),
63 );
64 insert_product(
65 core,
66 tx,
67 rx,
68 "p2",
69 serde_json::json!({
70 "name": "Sneaker", "brand": "Nike", "tags": ["new"], "sizes": ["M", "L", "XL"], "color": "blue"
71 }),
72 );
73 insert_product(
74 core,
75 tx,
76 rx,
77 "p3",
78 serde_json::json!({
79 "name": "Cap", "brand": "Adidas", "tags": ["sale", "clearance"], "sizes": ["S"], "color": "red"
80 }),
81 );
82 insert_product(
83 core,
84 tx,
85 rx,
86 "p4",
87 serde_json::json!({
88 "name": "Pants", "brand": "Puma", "tags": ["premium"], "sizes": ["M", "L"], "color": "blue"
89 }),
90 );
91}
92
93#[test]
94fn array_contains_filter() {

Callers 5

array_contains_filterFunction · 0.85
array_overlap_filterFunction · 0.85
array_agg_aggregateFunction · 0.85
no_match_returns_zeroFunction · 0.85

Calls 1

insert_productFunction · 0.70

Tested by

no test coverage detected