Prove dei percorsi uguali su Linux e su Windows

Tre prove scrivevano i percorsi attesi alla Linux («/tmp/febe-profilo», «/importa», la radice
seguita da «/») e fallivano su Windows, dove il prodotto dà giustamente il percorso completo
sull'unità corrente o il percorso scritto con «/». Ora l'atteso si calcola come lo calcola il
sistema: su Linux il testo resta identico a prima, su Windows le prove passano dove gira Febe
per Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-20 13:08:58 +02:00
1 parent edade61b72
commit d9d8a296b1
4 files changed
+10 -4

No files matched your search

+3 -1
View File
@@ -15,7 +15,9 @@ public sealed class HostingTests
var args = ChromiumCommandLine.Build(Options, new ChromiumLaunchOptions());
CollectionAssert.Contains(args.ToList(), "--remote-debugging-port=9333");
CollectionAssert.Contains(args.ToList(), "--user-data-dir=/tmp/febe-profilo");
// The profile reaches Chromium as a full path: «/tmp/febe-profilo» on Linux, rooted on the current drive on Windows.
CollectionAssert.Contains(args.ToList(), $"--user-data-dir={Path.GetFullPath(Options.ProfileDirectory)}");
CollectionAssert.Contains(args.ToList(), "--no-first-run");
CollectionAssert.Contains(args.ToList(), "--no-default-browser-check");
CollectionAssert.Contains(args.ToList(), "--window-size=1280,900");
@@ -27,7 +27,8 @@ public sealed class ImportSourcesTests
Assert.AreEqual(Path.Combine(root, "4K Stogram"), info.FullPath);
Assert.IsTrue(info.ReadOnly, "Il volume /importa è in sola lettura.");
Assert.IsFalse(info.CanMove);
Assert.AreEqual(root + "/4K Stogram", info.DisplayPath);
// Shown as in the container, with «/»: the same text as the root on Linux; on Windows the separators change too.
Assert.AreEqual(LibraryLayout.ToStored(root) + "/4K Stogram", info.DisplayPath);
var outside = Assert.ThrowsExactly<ImportSourceException>(() => sources.Inspect(temp.Combine("fuori")));
StringAssert.Contains(outside.Message, "sottocartella");
+4 -2
View File
@@ -163,10 +163,12 @@ public sealed class ImportApiTests
Assert.AreEqual(HttpStatusCode.BadRequest, sources, "desktop: the native picker, no listing");
}
// Docker: the sources live under /importa (absent on this machine: the listing says so).
// Docker: the sources live under /importa (absent on this machine: the listing says so). The root is reported as
// a full path: «/importa» in the container, rooted on the current drive where the edition runs for development
// on Windows.
await using var docker = await Part2.StartAsync();
var overview = await docker.GetJsonAsync("/api/import");
Assert.AreEqual("/importa", overview.Str("sourceRoot"));
Assert.AreEqual(Path.GetFullPath("/importa"), overview.Str("sourceRoot"));
Assert.IsFalse(overview.Bool("pickFolder"));
var (pick, _) = await docker.SendJsonAsync(HttpMethod.Post, "/api/import/pick-folder");
Assert.AreEqual(HttpStatusCode.BadRequest, pick);