aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/document/events.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/document/events.rs b/src/document/events.rs
index 37f1c70..5cc9943 100644
--- a/src/document/events.rs
+++ b/src/document/events.rs
@@ -249,20 +249,22 @@ pub(crate) fn is_genesis(change: &Change, fold: &str, id: &Id) -> bool {
root.is_some_and(|root| genesis(fold, &root).hash() == change.hash())
}
-/// `events`, each at its ID, put into `doc` by one change.
+/// `events`, each at its ID, put into `doc` by one change, at time 0: the same events put
+/// by the same writer make the same change.
#[cfg(test)]
pub(crate) fn put(doc: &mut Document, events: &[&[u8]]) {
- super::testing::change(doc, |doc| {
+ super::testing::try_change(doc, |doc| {
for bytes in events {
store::write_val_path(
doc,
&event(&Id::of(bytes)),
&Val::Scalar(ScalarValue::Bytes(bytes.to_vec())),
store::Writing::sticky(TimestampFormat::default()),
- )
- .expect("an event written");
+ )?;
}
- });
+ Ok::<(), store::StoreError>(())
+ })
+ .expect("events written");
}
#[cfg(test)]