Skip to content

Commit 259a447

Browse files
committed
test(audit): declare the intentional corrupt-tail error log in the ChainReset test
The resume path deliberately logs an Error when the tail line is corrupt (that IS the audited behavior under test); LogAssert.Expect it so Unity's unhandled-log check doesn't fail the otherwise-passing test.
1 parent 4a0f95a commit 259a447

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Assets/CoreAiUnity/Tests/EditMode/Audit/AuditLogVerifierEditModeTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ public void ResumeChain_TruncatedTailLine_AppendsChainResetMarker_AndVerifyDetec
114114
string truncatedTail = tail.Substring(0, tail.Length / 2);
115115
File.WriteAllText(filePath, head + truncatedTail);
116116

117+
// The resume path INTENTIONALLY logs an error when the tail is corrupt (that is the
118+
// audited chain-reset behavior under test) — declare it so LogAssert doesn't fail the test.
119+
UnityEngine.TestTools.LogAssert.Expect(
120+
LogType.Error,
121+
new System.Text.RegularExpressions.Regex(@"\[AuditLogWriter\] Audit log tail line is corrupt"));
122+
117123
using (AuditLogWriter resumed = new(_testFolder))
118124
{
119125
// ResumeChain() already flushed the marker synchronously; nothing else to do.

0 commit comments

Comments
 (0)