VM 복귀 후 예약턴 잠금 복구와 Windows 부팅 식별자 확인을 추가한다
This commit is contained in:
1 parent
fd8145d6eb
commit
f36bc2c8d7
24 files changed
+1048
-28
No files matched your search
@@ -3,12 +3,36 @@ import type { GameClockPhase } from '@sammo-ts/common';
|
||||
import { createRuntimePauseGate } from '../src/turn/runtimePauseGate.js';
|
||||
|
||||
describe('runtime pause clock boundary', () => {
|
||||
it('awaits a host authority check before reading profile state or changing the clock', async () => {
|
||||
const calls: string[] = [];
|
||||
const gate = createRuntimePauseGate({
|
||||
assertLease: async () => {
|
||||
await Promise.resolve();
|
||||
calls.push('host');
|
||||
throw new Error('host changed');
|
||||
},
|
||||
shouldPause: async () => {
|
||||
calls.push('profile');
|
||||
return false;
|
||||
},
|
||||
isExplicitlyPaused: () => false,
|
||||
getPhase: () => 'RUNNING',
|
||||
prepareRecovery: async () => {
|
||||
calls.push('recovery');
|
||||
},
|
||||
synchronize: async () => {},
|
||||
});
|
||||
await expect(gate()).rejects.toThrow('host changed');
|
||||
expect(calls).toEqual(['host']);
|
||||
});
|
||||
it('freezes a live error pause before commands, resumes without restart, and does not freeze twice', async () => {
|
||||
let phase: GameClockPhase = 'RUNNING';
|
||||
let paused = true;
|
||||
const calls: string[] = [];
|
||||
const gate = createRuntimePauseGate({
|
||||
assertLease: () => calls.push('lease'),
|
||||
assertLease: () => {
|
||||
calls.push('lease');
|
||||
},
|
||||
shouldPause: async () => paused,
|
||||
isExplicitlyPaused: () => paused,
|
||||
getPhase: () => phase,
|
||||
|
||||
Reference in new issue
Block a user