修复 GameFlow 清理异常测试日志断言

This commit is contained in:
JSD\13999
2026-05-19 11:29:36 +08:00
parent c0163d4d1c
commit 0257529a6f

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using FlowScope.Config; using FlowScope.Config;
@@ -7,6 +8,8 @@ using FlowScope.Flow;
using FlowScope.Resources; using FlowScope.Resources;
using FlowScope.Save; using FlowScope.Save;
using NUnit.Framework; using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using ContainerType = FlowScope.Container.Container; using ContainerType = FlowScope.Container.Container;
namespace FlowScope.Tests.EditMode.Flow namespace FlowScope.Tests.EditMode.Flow
@@ -110,6 +113,8 @@ namespace FlowScope.Tests.EditMode.Flow
var flow = new GameFlow(); var flow = new GameFlow();
flow.StartupAsync<ThrowingExitAndDisposeFeature>(root, CancellationToken.None).GetAwaiter().GetResult(); flow.StartupAsync<ThrowingExitAndDisposeFeature>(root, CancellationToken.None).GetAwaiter().GetResult();
LogAssert.Expect(LogType.Error, new Regex("System\\.InvalidOperationException: exit failed"));
LogAssert.Expect(LogType.Error, new Regex("System\\.InvalidOperationException: dispose failed"));
flow.ShutdownAsync(CancellationToken.None).GetAwaiter().GetResult(); flow.ShutdownAsync(CancellationToken.None).GetAwaiter().GetResult();
Assert.That(flow.State, Is.EqualTo(GameFlowState.Disposed)); Assert.That(flow.State, Is.EqualTo(GameFlowState.Disposed));