tools: the details group, the leak scenario's props and three fault classes (#22)
tools/details.test.mjs is the slice's WS acceptance: the five intents and their codes, a grow push clear of a wall, a squeeze in a corridor too narrow for the grown token, stuck from a wall and from a GM placement cleared by a removal and by a shrink, the GM source of a status, the caps and who reads which bucket, and a restart that brings size, props and statuses back. Waits use a cursor taken before the intent, so a repeated state cannot be matched by an older frame. The leak scenario gains a token in view with props in all three buckets, a GM-sourced status, a resize, a wall over it and the clears; leakcheck refuses the `gm` bucket (GM_PROP), the `owner` bucket on a non-controller (OWNER_PROP) and any `source` on a player status entry (STATUS_SOURCE), so `fault.test.mjs` now asserts all twelve classes. The schema-version fixtures in smoke/persistence move to 6, and mutation.sh gains am-au plus the renames.
This commit is contained in:
@@ -399,7 +399,7 @@ INSERT INTO entity (id, scene_id, kind, descriptive_name, actual_name, x, y, own
|
||||
PRAGMA user_version = 4;
|
||||
`
|
||||
|
||||
test('migration: a slice-5 DB (fixture, schema version 4) migrates under the real binary', async () => {
|
||||
test('migration: a schema-4 DB (fixture) migrates under the real binary to the latest schema', async () => {
|
||||
const stateDir = makeStateDir()
|
||||
const dbPath = `${stateDir}/state.db`
|
||||
const fixture = new DatabaseSync(dbPath)
|
||||
@@ -413,7 +413,7 @@ test('migration: a slice-5 DB (fixture, schema version 4) migrates under the rea
|
||||
}
|
||||
const s = await startServer({ stateDir })
|
||||
try {
|
||||
assert.match(s.log(), /db_ready .*schema_version=5 applied=1/, s.log())
|
||||
assert.match(s.log(), /db_ready .*schema_version=6 applied=2/, s.log())
|
||||
// The old data is served unchanged through the product surface.
|
||||
const alice = { id: 2, key: 'ALIC-ALIC-ALIC-ALIC-ALIC' }
|
||||
const conn = await openAs(s.origin, alice.key)
|
||||
@@ -434,10 +434,11 @@ test('migration: a slice-5 DB (fixture, schema version 4) migrates under the rea
|
||||
}
|
||||
const db = new DatabaseSync(dbPath)
|
||||
try {
|
||||
assert.equal(Number(db.prepare('PRAGMA user_version').get().user_version), 5)
|
||||
assert.equal(Number(db.prepare('PRAGMA user_version').get().user_version), 6)
|
||||
assert.deepEqual(db.prepare('SELECT version, name FROM schema_migration ORDER BY version').all()
|
||||
.map(r => [Number(r.version), r.name]),
|
||||
[[1, 'meta'], [2, 'auth'], [3, 'world'], [4, 'tokens'], [5, 'explored']])
|
||||
[[1, 'meta'], [2, 'auth'], [3, 'world'], [4, 'tokens'], [5, 'explored'],
|
||||
[6, 'token details']])
|
||||
assert.equal(Number(db.prepare('SELECT count(*) AS n FROM explored_chunk').get().n), 0)
|
||||
assert.equal(db.prepare('SELECT name FROM player WHERE id = 2').get().name, 'Alice')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user