Cotton code
20 lines · 839 B · KotlinRaw
package com.cottondb.messages.chatimport org.junit.Assert.assertEqualsimport org.junit.Test/** * A GROUP'S CHANGE IS TOLD AT ONCE (walk, 21 Nov 2026): Meera renamed "Book club" and removed Tara on her phone, and * neither Kabir's nor Tara's saw it until Meera next wrote; a new group reached nobody until its first message. Every * `chat.group.*` verb that changes the group now flushes (the core tells the members at `chat.flush`); a read does not. */class GroupTellsTest {    @Test    fun each_change_is_told_and_no_read_is() {        val verbs = listOf("create", "add", "remove", "leave", "admin", "rename", "picture", "info", "photo", "receipts")        assertEquals(            listOf("create", "add", "remove", "leave", "admin", "rename", "picture"),            verbs.filter { ChatData.tells(it) },        )    }}