Skip to main content

Module conformance

Module conformance 

Source
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::Map at 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::Null deletes 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::Map containing the children.
check_read_children
read_children enumerates direct children at a prefix.