Files
Chronos/tests/Chronos.App.Tests/Import/ImportLanguageTests.cs
T
Alby96andClaude Opus 5.5 1f089888e8
CI / Build and test (push) Successful in 5m11s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 8m57s
CI / PostgreSQL 16 integration (push) Successful in 3m10s
CI / PostgreSQL 17 integration (push) Successful in 3m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m4s
feat: owner review 2 phase 1: :latest, Unraid array space, Settings with About, whole-folder import (#9)
- :latest follows the highest stable release, or the highest pre-release while none is stable (Chronos.Tools release-channels); bad tags are refused before anything is built.
- Unraid: CHRONOS_SPACE_PATH and the template's Array view show the array's free space; the write volume (cache) is shown apart; completions check the archive volume (507).
- Settings is a gear, docked at the foot of the admin sidebar; About is the last part of Settings on the desktop and the panel.
- Import > Folder > Whole folder: one sequence per format (desktop only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-10-27 01:09:59 +01:00

59 lines
2.3 KiB
C#

using System.Globalization;
using Chronos.App.Import;
using Chronos.Core.Localization;
using Chronos.Testing;
using static Chronos.App.Tests.Import.CardPoolTests;
using static Chronos.App.Tests.Import.ImportPlansTests;
namespace Chronos.App.Tests.Import;
/// <summary>
/// Import texts in a right-to-left language. They switch the process-wide UI language, so the class is serial: in
/// parallel it would race with the English assertions of the classes running beside it.
/// </summary>
[Serial]
public sealed class ImportLanguageTests
{
public ImportLanguageTests() => Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
[Test]
public void PathsAndSerialsStayLeftToRightInARightToLeftLanguage()
{
try
{
Loc.SetCulture(CultureInfo.GetCultureInfo("he"));
var pool = CardPool.Build([Usb with { Label = string.Empty }, CardA], [], @"D:\Shoots\");
Assert.Equal("\u202AG:\\\u202C", pool[1].Title, "a drive root keeps its separator at its end");
Assert.Equal("\u202AD:\\Shoots\\\u202C", pool[2].Title);
Assert.Equal("\u202AD:\\Shoots\\\u202C", pool[2].Subtitle);
Assert.Contains("\u202A3F2A-9C11\u202C", pool[0].IdentityText);
Assert.Equal("EOS_DIGITAL", pool[0].Title, "a label is left to bidi");
}
finally
{
Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
}
}
[Test]
public void ARightToLeftLanguageReadsTheSessionTimesWithItsOwnArrow()
{
var plan = ThreeSessions();
Assert.Contains("→", ImportPlans.Sessions(plan, ImportDestinationKind.Archive, new HashSet<string>())[0].TimeText);
try
{
Loc.SetCulture(CultureInfo.GetCultureInfo("he"));
var time = ImportPlans.Sessions(plan, ImportDestinationKind.Archive, new HashSet<string>())[0].TimeText;
Assert.Contains("←", time);
Assert.False(time.Contains('→'), "a right-to-left reader would see the arrow point back to the start");
var days = ImportPlans.Sessions(OverEightDays(), ImportDestinationKind.Archive, new HashSet<string>())[0].TimeText;
Assert.Contains("←", days);
Assert.False(days.Contains('→'), "also between two dates");
}
finally
{
Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
}
}
}