Skip to main content

Module testing

Module testing 

Source
Expand description

A synthetic format before FORMAT and the chain from it, for tests of migrations through a store’s own reads and writes. Rig never wrote this format, and SHIPPED has no step from it.

use rig_memory::migration::testing;
use rig_memory::{MemoryStore, Session};

let store = MemoryStore::default();
testing::write_fixture(&store)?;
assert!(Session::read(&store).is_err());
testing::CHAIN.migrate(&store, &|_, _| Ok(()))?;
Session::read(&store)?;

Constants§

CHAIN
The chain from SYNTHETIC.
SYNTHETIC
The synthetic format: as FORMAT, with its blobs under SYNTHETIC_BLOBS in place of BLOBS.
SYNTHETIC_BLOBS
Where a session in SYNTHETIC keeps its blobs.
UNINSTALLED
The key of a saved value of a plugin that is not installed, which the fixture holds.
UNINSTALLED_FILE
The file of a plugin that is not installed, which the fixture holds.

Functions§

write_fixture
Writes a session in SYNTHETIC into the empty store, generated by today’s writer and turned back by the inverse of the step: two messages, one with an image; an aside and a saved value of a plugin that is not installed; the session’s listing; and a plugin’s file.