This replaces the blocked history in PR #3 with one properly attributed, signed/DCO commit. The owner personally reviewed and approved PR #3 in the release session. **No file changes from the approved candidate:** bothbaee14f492ande605df62c4have exact Git treea85912cbad. Original PR #3 and its commits are preserved for review history. Historical commits were locally signed but GitHub reported no_user; protected merge checks those introduced commits even for squash merging. This commit resolves attribution without bypassing or weakening signature rules. The reader, Settings, themes, source highlighting/split, live reload, file associations, Print/PDF, About credits, toolbar/footer/editor fixes, user-first README/screenshots and developer guides are exactly the approved implementation. Stable/dev separation and protected Azure signing caller are unchanged. Evidence: - Approved treebaee14f/ CI38285775463 passes all checks. Downloaded focused29/29, published111/111, stable110/110 and dev110/110 TRXs have zero failures/skips. Core coverage100% lines/98.86% branches; actual update/restart/coexistence/default-preservation receipts verify. - New single-commit hooks, online workflow security, signing and DCO pass. GitHub must rerun all required checks on this commit; results are not copied across SHAs. - Live repository setup validates18 Actions-bound checks, with only fuzzing added and all prior protections preserved. - OpenSSF project15417 is now owner-reviewed and saved at70% under owner-confirmed CDLA-Permissive2.0. This is an in-progress assessment, not a passing badge. - Production CI OIDC and signed1.0/dev publication remain required; local representative signing is not CI proof. Substantial AI assistance: Codex (GPT-6). Supersedes PR #3. Release work remains tracked in #33. Closes #4, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #32, #34. Refs #1, #5, #30, #31, #33. Signed-off-by: James Maes <james@kof22.com> Co-authored-by: Codex GPT-6 <noreply@openai.com>
51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
/*
|
|
* Copyright (c) 2026 James Maes
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
using MarkdownViewr.Windows.Core.Layout;
|
|
|
|
|
|
namespace MarkdownViewr.Windows.Core.Tests;
|
|
|
|
/// <summary>Checks usable source/document bounds, equal reopening and unconstrained large-window resizing.</summary>
|
|
public sealed class SourcePaneLayoutTests
|
|
{
|
|
/// <summary>Initial columns remain equal at supported widths, even when there is no measured space yet.</summary>
|
|
[Theory]
|
|
[InlineData(0)]
|
|
[InlineData(-1)]
|
|
[InlineData(double.NaN)]
|
|
[InlineData(double.PositiveInfinity)]
|
|
[InlineData(280)]
|
|
[InlineData(800)]
|
|
[InlineData(2000)]
|
|
public void Fraction_InitialWidth_ReturnsEqualColumns(double available) => Assert.Equal(0.5, SourcePaneLayout.Fraction(available));
|
|
|
|
|
|
|
|
/// <summary>Invalid ratios recover safely; bounded edges protect both panes and allow source to exceed600px.</summary>
|
|
[Theory]
|
|
[InlineData(1000, double.NaN, 0.5)]
|
|
[InlineData(1000, -10, 0.16)]
|
|
[InlineData(1000, 10, 0.8)]
|
|
[InlineData(2000, 0.6, 0.6)]
|
|
[InlineData(200, 0.9, 0.5)]
|
|
public void Fraction_PreferredRatio_ProtectsUsableColumns(double available, double preferred, double expected) => Assert.Equal(expected, SourcePaneLayout.Fraction(available, preferred), precision: 8);
|
|
|
|
|
|
|
|
/// <summary>Left/right movement changes the split in the correct direction, including physical-space clamping.</summary>
|
|
[Theory]
|
|
[InlineData(1000, 500, -70, 0.57)]
|
|
[InlineData(1000, 500, 70, 0.43)]
|
|
[InlineData(1000, 500, -900, 0.8)]
|
|
[InlineData(1000, 500, 900, 0.16)]
|
|
[InlineData(2000, 1000, -200, 0.6)]
|
|
[InlineData(0, 500, 70, 0.5)]
|
|
[InlineData(double.NaN, 500, 70, 0.5)]
|
|
[InlineData(1000, double.NaN, 70, 0.5)]
|
|
[InlineData(1000, 500, double.NaN, 0.5)]
|
|
public void Resize_Drag_RespectsDirectionAndBounds(double available, double sourceWidth, double delta, double expected) => Assert.Equal(expected, SourcePaneLayout.Resize(available, sourceWidth, delta), precision: 8);
|
|
}
|