test(installer): add InstallManifest wrong-shape json test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user