Until 0.1.0-alpha.3 an alpha was "a beta's source built on a prerelease .NET" and every text said so. 0.1.0-alpha.4 runs on .NET 11's release - the betas' own from beta.37 - and the alpha line rests after it. - EULA 1.7 (section 2B), Disclaimer 2.14 (section 0, which also gains the paragraph on Windows and the processor), Alpha notice 1.1 (what an alpha is, the hardware, the pause), the accuracy statement's line and its two copies. The texts were approved with the plan of 2026-11-11. - Shared.AlphaLine: IsPrerelease(the runtime's description) and Rests, stamped from Directory.Build.props' FlAlphaLineRests (true on main since beta.37; set to false on the alpha branch when it tries a newer .NET). App/Services/AlphaTexts picks the banner and About's line from the two facts; a prerelease runtime is said whatever the stamp says. - Strings in en, vi and ja: the banner and About's line no longer say "a prerelease .NET" unconditionally; three new keys. - guide (the alphas are paused: install the beta; a paused alpha's anti-cheat list is not updated; ten betas after alpha.4 hide it from older alphas), LIMITATIONS, 11_UPDATER, 12_BUILD, 08_UI, the wiki. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
74 lines
3.2 KiB
C#
74 lines
3.2 KiB
C#
// SPDX-License-Identifier: GPL-3.0-only
|
|
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
|
|
|
using System.Reflection;
|
|
using FluentAssertions;
|
|
using FrameLedger.Shared;
|
|
|
|
namespace FrameLedger.Infrastructure.Tests;
|
|
|
|
/// <summary>
|
|
/// D97 and D98 (2026-11-11): what an alpha says about its .NET follows the runtime's own description, and that its line is
|
|
/// paused follows a stamp <c>Directory.Build.props</c> writes. Like <see cref="BuildLineTests"/>, the stamp's test holds on
|
|
/// both branches: it pins that the build carries what the file says, not which value that is.
|
|
/// </summary>
|
|
public sealed class AlphaLineTests
|
|
{
|
|
private static string RepoRoot()
|
|
{
|
|
for (DirectoryInfo? dir = new(AppContext.BaseDirectory); dir is not null; dir = dir.Parent)
|
|
{
|
|
if (File.Exists(Path.Combine(dir.FullName, "FrameLedger.slnx")))
|
|
{
|
|
return dir.FullName;
|
|
}
|
|
}
|
|
|
|
throw new InvalidOperationException("the repository root (FrameLedger.slnx) is not above " + AppContext.BaseDirectory);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(".NET 11.0.0", false)]
|
|
[InlineData(".NET 11.0.1", false)]
|
|
[InlineData(".NET 10.0.15", false)]
|
|
[InlineData(".NET 11.0.0-rc.3.26522.148", true)]
|
|
[InlineData(".NET 12.0.0-preview.1.27101.5", true)]
|
|
[InlineData(".NET 11.0.0-rc.3.26522.148 ", true)]
|
|
[InlineData("11.0.0", false)]
|
|
[InlineData("", false)]
|
|
public void ARuntimeIsAPrereleaseWhenItsVersionCarriesAHyphen(string description, bool prerelease) =>
|
|
AlphaLine.IsPrerelease(description).Should().Be(prerelease);
|
|
|
|
[Fact]
|
|
public void AHyphenBeforeTheVersionIsNotThePrereleaseMark() =>
|
|
AlphaLine.IsPrerelease("Some-Runtime 11.0.0").Should().BeFalse("the version is the last word, and it has no hyphen");
|
|
|
|
[Theory]
|
|
[InlineData("true", true)]
|
|
[InlineData("True", true)]
|
|
[InlineData("false", false)]
|
|
[InlineData("", false)]
|
|
[InlineData(null, false)]
|
|
[InlineData("yes", false)]
|
|
public void OnlyTheWordTrueSaysTheLineRests(string? stamped, bool rests) => AlphaLine.ParseRests(stamped).Should().Be(rests);
|
|
|
|
[Fact]
|
|
public void TheBuildCarriesWhatDirectoryBuildPropsSaysAboutTheAlphaLine()
|
|
{
|
|
const string open = "<FlAlphaLineRests>";
|
|
const string close = "</FlAlphaLineRests>";
|
|
string props = File.ReadAllText(Path.Combine(RepoRoot(), "Directory.Build.props"));
|
|
int from = props.IndexOf(open, StringComparison.Ordinal);
|
|
int to = props.IndexOf(close, StringComparison.Ordinal);
|
|
string? stamped = typeof(AlphaLine).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
|
|
.FirstOrDefault(static a => string.Equals(a.Key, AlphaLine.RestsMetadataKey, StringComparison.Ordinal))?.Value;
|
|
|
|
from.Should().BeGreaterThanOrEqualTo(0, "Directory.Build.props declares FlAlphaLineRests");
|
|
to.Should().BeGreaterThan(from);
|
|
string declared = props[(from + open.Length)..to];
|
|
declared.Should().BeOneOf("true", "false");
|
|
stamped.Should().Be(declared, "Directory.Build.props stamps the property into every assembly");
|
|
AlphaLine.Rests.Should().Be(string.Equals(declared, "true", StringComparison.Ordinal));
|
|
}
|
|
}
|