fix(projects): address the line-end review

StillRestores compared the restored version with the new version's parent
as raw text, so a version an older Windows build stored with CRLF never
matched the same choices written as LF, and a commit on a parent already
holding the restored version was labelled a restore. It now compares them
with SameChoices, like every other project text comparison.

The LF line ends of the project writers were only checked through
Environment.NewLine, which is LF on Linux CI already; the tests now assert
the NewLine option of ProjectJson and IndentedJson directly, so reverting
either fails on every OS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-04 23:09:30 +01:00
1 parent 787f030060
commit d2332687da
4 files changed
+34 -2

No files matched your search

@@ -351,6 +351,9 @@ public sealed class ProjectContentTests
var frames = Frames(Photo(1), Photo(2), Photo(3));
var lf = ProjectContent.ToPortable(Positions([1], 2, 0), frames);
var crlf = lf.Replace("\n", "\r\n", StringComparison.Ordinal);
// Every writer of project text names LF itself: on Linux Environment.NewLine is LF already, so only these fail there.
Assert.Equal("\n", ProjectJson.Default.Options.NewLine);
Assert.Equal("\n", ProjectSettings.IndentedJson.NewLine);
Assert.False(lf.Contains('\r', StringComparison.Ordinal), "portable");
Assert.False(new ProjectSettings().ToJson().Contains('\r', StringComparison.Ordinal), "ToJson");
Assert.Equal(lf, ProjectContent.Canonical(crlf));