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

Function deterministic

nodedb-query/src/chunk_text.rs:453–463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451
452 #[test]
453 fn deterministic() {
454 let text = "Deterministic output means same input produces same output every time.";
455 let a = chunk_text(text, 15, 3, ChunkStrategy::Character).unwrap();
456 let b = chunk_text(text, 15, 3, ChunkStrategy::Character).unwrap();
457 assert_eq!(a.len(), b.len());
458 for (ca, cb) in a.iter().zip(b.iter()) {
459 assert_eq!(ca.text, cb.text);
460 assert_eq!(ca.start, cb.start);
461 assert_eq!(ca.end, cb.end);
462 }
463 }
464
465 #[test]
466 fn overlap_produces_shared_chars() {

Callers

nothing calls this directly

Calls 2

chunk_textFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected