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

Function fuzz_non_map_inputs

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

Source from the content-addressed store, hash-verified

271 /// Non-map inputs must return None from build.
272 #[test]
273 fn fuzz_non_map_inputs() {
274 let array_buf = encode(&json!([1, 2, 3]));
275 assert!(FieldIndex::build(&array_buf, 0).is_none());
276
277 let int_buf = encode(&json!(99));
278 assert!(FieldIndex::build(&int_buf, 0).is_none());
279
280 assert!(FieldIndex::build(&[], 0).is_none());
281
282 let nil_buf = [0xc0u8];
283 assert!(FieldIndex::build(&nil_buf, 0).is_none());
284 }
285
286 /// Out-of-bounds offset must return None.
287 #[test]

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected