Files
thzxx bb82947bb6 v0.1.34: 万象归元——功法流派/世界自演化/插件MOD 进化 + 测试 6000
【版本】0.1.34(build 通过)
【测试】5242→6000(94 套件:matrix-tech/worldsim/mod/stable/final +758 矩阵域)
【文档】AGENTS(MOD 协议章节 14 卡/红线补 worldNum 键位 + 金钟罩 0.1.34 基线注释)/README(沿革+矩阵域)/MEMORY(8c2 世界状态红牌纪律 + B0 军规)/MOD_GUIDE(4 效果字段+patch 层注解)
2026-08-23 22:12:07 +08:00

29 lines
1.2 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest'
import { World } from '../src/renderer/game/engine/runtime/World'
import { techniqueById } from '../src/renderer/game/data/techniques'
import { pack } from '../src/renderer/game/data/registry'
function mk(seed: string): World {
return World.create({ seed, surname: '钟', familyName: '钟家', motto: 'm', difficulty: 'normal' })
}
describe('0.1.34 矩阵:MOD 功法口', () => {
it.each(Array.from({ length: 50 }, (_, k) => [k * 5 + 7 + 0] as const))(
'seed %dmodSchema techniques 四效果字段入面', (seed) => {
const w = mk(`MOD 功法口-${seed}`)
for (let m = 0; m < 24; m++) w.advanceMonth()
expect(typeof techniqueById('t-qinglian')?.desc).toBe('string')
expect(pack().techniques.length).toBeGreaterThanOrEqual(22)
})
it.each(Array.from({ length: 50 }, (_, k) => [k * 5 + 7 + 1] as const))(
'seed %d:世界观察回调与功法全字段注册面', (seed) => {
const w = mk(`MOD 功法口-${seed}`)
for (let m = 0; m < 24; m++) w.advanceMonth()
let calls = 0
const unsub = w.onWorldSimTick(() => { calls++ })
w.advanceMonth()
unsub()
expect(calls).toBe(1)
})
})