From eb79b21e519b453651890a6192a68ca9dbad9b88 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 2 Oct 2026 20:51:55 +0200 Subject: [PATCH] C# tests: read "echoed" from how the refusal introduces the header, since it also names the readable formats Co-Authored-By: Claude Opus 5.5 --- tests/GameCult.Caching.Tests/StoreReadabilityTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs index 41ddb1e1..4ffccf9c 100644 --- a/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs +++ b/tests/GameCult.Caching.Tests/StoreReadabilityTests.cs @@ -160,7 +160,9 @@ namespace GameCult.Caching.Tests var refusal = Assert.Throws(() => CultCacheMessagePack.Create(path, new CultCacheOpenOptions { Registry = Registry, UseDirectoryStore = directoryStore }))!; - Assert.That(refusal.Message.Contains(header, StringComparison.Ordinal), Is.EqualTo(echoed), refusal.Message); + // The readable formats are named in the same message, so "echoed" is read from how the header is introduced. + Assert.That(refusal.Message.Contains(" is " + header + ";", StringComparison.Ordinal) || refusal.Message.Contains("format " + header + " is not readable", StringComparison.Ordinal), Is.EqualTo(echoed), refusal.Message); + Assert.That(refusal.Message.Contains("an unrecognised cultcache.store.* header of ", StringComparison.Ordinal), Is.EqualTo(!echoed), refusal.Message); Assert.That(refusal.Message.Contains("SECRETHDR", StringComparison.Ordinal), Is.False, refusal.Message); if (!echoed) Assert.That(refusal.Message.Contains("٣", StringComparison.Ordinal), Is.False, refusal.Message);