Expand description
Conformance checks for the StructFS store conventions.
StructFS asserts several semantics by convention rather than by trait signature. This module makes them checkable: call these functions from a store’s test suite to certify it instead of re-deriving the semantics by hand.
Each check panics with a descriptive message on violation, so calling
one from a #[test] is all a store’s suite needs:
use structfs_core_store::{conformance, MemoryStore};
conformance::check_conventions(&mut MemoryStore::new());The checks write under top-level components prefixed conformance_;
run them against a fresh store instance.
Functions§
- check_
conventions - Run every convention check against a fresh store.
- check_
deep_ write_ creates_ intermediates - Writing a deep path creates intermediate maps.
- check_
leaf_ roundtrip - A leaf written at a path reads back equal.
- check_
map_ write_ replaces_ subtree - Writing a
Value::Mapat a parent replaces the full state under that path; stale descendants do not survive. - check_
missing_ reads_ none - Reading a path that was never written returns
Ok(None). - check_
null_ write_ deletes_ subtree - Writing
Value::Nulldeletes the node and its entire subtree, without touching siblings whose names merely share a string prefix. - check_
prefix_ read_ returns_ children - Reading at a prefix returns a
Value::Mapcontaining the children. - check_
read_ children read_childrenenumerates direct children at a prefix.