add FRAME_SYNC
This commit is contained in:
@@ -63,13 +63,12 @@ fn test_canonical_cartridge_heartbeat() {
|
||||
}
|
||||
|
||||
// 2. Deterministic output state (if any)
|
||||
// In our frame(), z should be 30.
|
||||
// Local 2 in frame() should be 30.
|
||||
// Let's check the stack or locals if possible.
|
||||
|
||||
// The VM should have finished 'frame'.
|
||||
// Since 'frame' returns void, the stack should be empty (or have the return value if any, but it's void).
|
||||
assert_eq!(vm.operand_stack.len(), 0, "Stack should be empty after frame() execution");
|
||||
// Observação: a PVM agora sinaliza FRAME_SYNC imediatamente antes do RET do entry point.
|
||||
// Quando o motivo é FRAME_SYNC, não exigimos pilha vazia (a limpeza final ocorre após o RET).
|
||||
// Para os demais motivos (RET/Halted/EndOfRom), a pilha deve estar vazia para frame(): void.
|
||||
if !matches!(report.reason, LogicalFrameEndingReason::FrameSync) {
|
||||
assert_eq!(vm.operand_stack.len(), 0, "Stack should be empty after frame() execution");
|
||||
}
|
||||
|
||||
println!("Heartbeat test passed!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user