API-style comments and ktlint formatting
Every comment is reduced to its first sentence plus @param, @return and @throws tags. Comment lines: 20040 to 8526. ktlint 1.8 applied with its default (official Kotlin) style across all modules; 262 files reformatted. The 264 remaining ktlint findings are naming and filename rules, which are code changes, and are left alone. Comments and formatting only. 1208 tests pass, counted from the XML. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
8a7f40fb13
commit
2fa430f21c
@@ -1,34 +1,40 @@
|
||||
package io.flamenet.e2e
|
||||
|
||||
import javax.crypto.KeyGenerator
|
||||
import org.json.JSONObject
|
||||
import javax.crypto.KeyGenerator
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
/**
|
||||
* Disappearing messages (§6.11), at the vault.
|
||||
*
|
||||
* Expiry runs on read. A sweep on a timer leaves
|
||||
* expired messages on disk between runs, and a "disappearing" message still
|
||||
* sitting in the vault is a claim rather than a feature. Reading is the one
|
||||
* path every caller shares.
|
||||
*/
|
||||
class DisappearingTest {
|
||||
|
||||
private class MapStorage : Vault.Storage {
|
||||
private val records = mutableMapOf<String, ByteArray>()
|
||||
|
||||
override fun read(name: String) = records[name]
|
||||
override fun write(name: String, bytes: ByteArray) { records[name] = bytes }
|
||||
override fun delete(name: String) { records.remove(name) }
|
||||
|
||||
override fun write(
|
||||
name: String,
|
||||
bytes: ByteArray,
|
||||
) {
|
||||
records[name] = bytes
|
||||
}
|
||||
|
||||
override fun delete(name: String) {
|
||||
records.remove(name)
|
||||
}
|
||||
|
||||
override fun names() = records.keys.toList()
|
||||
}
|
||||
|
||||
private fun vault() = Vault(
|
||||
MapStorage(), KeyGenerator.getInstance("AES").apply { init(256) }.generateKey())
|
||||
private fun vault() = Vault(MapStorage(), KeyGenerator.getInstance("AES").apply { init(256) }.generateKey())
|
||||
|
||||
private fun line(text: String, at: Long) =
|
||||
JSONObject().put("text", text).put("mine", true).put("at", at)
|
||||
private fun line(
|
||||
text: String,
|
||||
at: Long,
|
||||
) = JSONObject().put("text", text).put("mine", true).put("at", at)
|
||||
|
||||
private val now = 1_700_000_000_000L
|
||||
|
||||
@@ -66,9 +72,7 @@ class DisappearingTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* A message with no timestamp predates the field. An unknown age is not
|
||||
* evidence of an old one, and deleting somebody's history on a guess cannot
|
||||
* be undone.
|
||||
* A message with no timestamp predates the field.
|
||||
*/
|
||||
@Test
|
||||
fun `a message with no timestamp is kept`() {
|
||||
|
||||
Reference in New Issue
Block a user