From 2fc6924dcbc079918e7dffe8ebe3bc42593d41dd Mon Sep 17 00:00:00 2001 From: Mika Kuns Date: Wed, 15 Apr 2026 08:59:51 +0200 Subject: [PATCH] test(installer): add InstallManifest wrong-shape json test Co-Authored-By: Claude Sonnet 4.6 --- .../InstallManifestStoreTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/ClaudeDo.Installer.Tests/InstallManifestStoreTests.cs b/tests/ClaudeDo.Installer.Tests/InstallManifestStoreTests.cs index 553773b..ff7565f 100644 --- a/tests/ClaudeDo.Installer.Tests/InstallManifestStoreTests.cs +++ b/tests/ClaudeDo.Installer.Tests/InstallManifestStoreTests.cs @@ -63,4 +63,14 @@ public sealed class InstallManifestStoreTests : IDisposable var result = InstallManifestStore.TryRead(_tempDir); Assert.Null(result); } + + [Fact] + public void TryRead_ReturnsNull_WhenJsonIsValidButShapeIsWrong() + { + // Valid JSON, but installedAt has a wrong type — causes JsonException, swallowed silently. + File.WriteAllText(Path.Combine(_tempDir, "install.json"), + """{"version":"1.0","installDir":"x","workerDir":"y","installedAt":12345}"""); + var result = InstallManifestStore.TryRead(_tempDir); + Assert.Null(result); + } }