From 56cac370eb7c6d8af7fc7319e6f06650f9dd92f2 Mon Sep 17 00:00:00 2001 From: Jean Date: Thu, 16 Jul 2026 11:15:57 +0000 Subject: [PATCH] test: cover removal/mutation events in the parity property tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends build_broad_state with vhost/suspend/akill/forbid/news/cert/access/ group-member removals and a memo read — the asymmetric removal apply arms are exactly where the drop-purge bug hid. Both the fold-parity and compaction round-trip tests pass over the full ~55-operation sequence, so live==replay ==compacted holds across adds, mutations and removals. --- src/engine/db/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/engine/db/tests.rs b/src/engine/db/tests.rs index 5ebd297..dcefe33 100644 --- a/src/engine/db/tests.rs +++ b/src/engine/db/tests.rs @@ -569,6 +569,24 @@ db.oper_grant("carol", vec!["admin".into()], None); db.session_except_add("*@trusted.host", 10, "trusted"); db.group_set_founder("!other", "carol").unwrap(); + // Removal / mutation events — where live-vs-apply asymmetries hide. + db.set_vhost("bob", "bob.temp", "oper", None).unwrap(); + db.del_vhost("bob").unwrap(); + db.suspend_account("carol", "oper", "oops", None).unwrap(); + db.unsuspend_account("carol").unwrap(); + db.akill_add("Q", "spam*", "oper", "nick", None).unwrap(); + db.akill_del("Q", "spam*").unwrap(); + db.forbid_add("CHAN", "#evil*", "oper", "bad").unwrap(); + db.forbid_del("CHAN", "#evil*").unwrap(); + let nid = db.news_add("logon", "temp notice", "oper"); + db.news_del(nid); + db.certfp_add("bob", "1122334455667788990011223344556677889900").unwrap(); + db.certfp_del("bob", "1122334455667788990011223344556677889900").unwrap(); + db.access_add("#chan", "carol", "voice").unwrap(); + db.access_del("#chan", "carol").unwrap(); + db.group_set_flags("!other", "bob", "").unwrap(); + db.group_del_member("!other", "bob").unwrap(); + db.memo_read("carol", 0); // The compound one: dropping alice must purge her access, successorship // and group standing — identically in the live path and on replay. db.drop_account("alice").unwrap();