Tests: internal/domain
internal/domain · 17 tests
Each test is named for the property it holds, and runs against a real deployment: there is no mock of the database and no arm that skips when it is absent. The sentence is the test's name read back; the name is what go test -run takes.
domain_test.go
- Only the user speaks for the principal —
TestOnlyTheUserSpeaksForThePrincipal. The role policy in one assertion. - Only the closed set is valid —
TestOnlyTheClosedSetIsValid - A turn without a speaker is refused —
TestATurnWithoutASpeakerIsRefused - A rejection says which message —
TestARejectionSaysWhichMessage. The rejection has to name the offending message, because a turn is a batch and "invalid turn" leaves the caller diffing their own payload. - Normalization merges casing and whitespace and nothing else —
TestNormalizationMergesCasingAndWhitespaceAndNothingElse - Ontology rejects empty and duplicate relations —
TestOntologyRejectsEmptyAndDuplicateRelations - Erasure clean reports residual rows —
TestErasureCleanReportsResidualRows - An audit entry that could not be counted is refused —
TestAnAuditEntryThatCouldNotBeCountedIsRefused - An unattributed operation is refused with the reason —
TestAnUnattributedOperationIsRefusedWithTheReason. An unattributed operation is the one thing the ledger cannot hold, so the refusal says so rather than naming a column. - Every recorded operation is one the ledger accepts —
TestEveryRecordedOperationIsOneTheLedgerAccepts. Every operation the API can perform is one the ledger knows about. - The context always contains the words it is context for —
TestTheContextAlwaysContainsTheWordsItIsContextFor. The property the whole feature rests on: whatever the window did at its edges, the cited words are inside what comes back, at the offset the citation says they are. - Context says whether it is the whole message —
TestContextSaysWhetherItIsTheWholeMessage. Complete is the difference between "this is the message" and "this is part of it". - A cut edge is repaired and only the cut edge —
TestACutEdgeIsRepairedAndOnlyTheCutEdge. A cut edge lands mid-word and mid-rune. - A window with no word boundary keeps what it has —
TestAWindowWithNoWordBoundaryKeepsWhatItHas. One long word with no whitespace in it — a URL, a stack frame, a base64 blob. - A window that does not hold its quote returns nothing —
TestAWindowThatDoesNotHoldItsQuoteReturnsNothing. A window that does not hold its own quote is not context for it, and returning the bytes anyway would be a receipt pointing at the wrong words while looking correct.
observationlimits_test.go
- Observation resource limits count bytes and preserve the boundary —
TestObservationResourceLimitsCountBytesAndPreserveTheBoundary
rebuildaudit_test.go
- Project rebuild control operations are auditable —
TestProjectRebuildControlOperationsAreAuditable