test(analysis): cover empty and fully unreadable deep-analysis sources
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
1 file changed
+17
-1
@@ -219,6 +219,22 @@ public sealed class DeepAnalyzerTests(TestContext context)
|
||||
Assert.Equal(TimeSpan.Zero, reports[^1].Eta);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task EmptyAndUnreadableSequencesGiveEmptyReports()
|
||||
{
|
||||
var empty = await DeepAnalyzer.AnalyzeAsync(new SplicedSource(new SyntheticFrameSource(DeepScenes.HolyGrail()), null!, 0) { Count = 0 }, DeepScenes.Options);
|
||||
Assert.Equal(0, empty.FrameCount);
|
||||
Assert.Equal(DayNight.Unknown, empty.Sky.Light);
|
||||
Assert.Empty(empty.Findings);
|
||||
|
||||
var unreadable = await DeepAnalyzer.AnalyzeAsync(new SyntheticFrameSource(SyntheticSequence.Create(new SyntheticSequenceOptions { FrameCount = 3 })) { Undecodable = [0, 1, 2] }, DeepScenes.Options);
|
||||
Assert.Equal(DayNight.Unknown, unreadable.Sky.Light);
|
||||
Assert.Null(unreadable.HeroIndex);
|
||||
Assert.Null(unreadable.Regions);
|
||||
Assert.SequenceEqual([0, 1, 2], unreadable.Issues.Undecodable);
|
||||
Assert.Equal(unreadable.ToJson(), DeepAnalysisReport.FromJson(unreadable.ToJson()).ToJson());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StarDetectorCountsPointsButNotBlobs()
|
||||
{
|
||||
@@ -283,7 +299,7 @@ public sealed class DeepAnalyzerTests(TestContext context)
|
||||
/// <summary>Frames of <paramref name="first"/> before <paramref name="cut"/>, then frames of <paramref name="second"/>.</summary>
|
||||
private sealed class SplicedSource(IFrameSource first, IFrameSource second, int cut) : IFrameSource
|
||||
{
|
||||
public int Count => first.Count;
|
||||
public int Count { get; init; } = first.Count;
|
||||
|
||||
public LightFrame Metadata(int index) => first.Metadata(index);
|
||||
|
||||
|
||||
Reference in new issue
Block a user