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

Function small_doc_uses_flat

nodedb-query/src/msgpack_scan/index.rs:159–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157
158 #[test]
159 fn small_doc_uses_flat() {
160 let mut map = serde_json::Map::new();
161 for i in 0..10 {
162 map.insert(format!("f{i}"), json!(i));
163 }
164 let buf = encode(&serde_json::Value::Object(map));
165 let idx = FieldIndex::build(&buf, 0).unwrap();
166 assert_eq!(idx.len(), 10);
167 assert!(matches!(idx.inner, IndexInner::Flat(_)));
168 }
169
170 #[test]
171 fn large_doc_uses_hashmap() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected