Stufe 4c (#764): Kommentare in C#, WebUI-Skripten, CSS und HTML auf Englisch
Rund 2.600 Kommentarblöcke in 310 C#-Dateien übersetzt, Begründungen vollständig erhalten: blockweise gleiche Anzahl wie vorher, kein Block unter 60 % seiner Länge, der Code außerhalb der Kommentare per Tokenizer byte-identisch geprüft. Zitate deutscher Oberflächentexte und Testdaten bleiben deutsch. WebUI: Kommentare in JS/CSS/HTML übersetzt, JSDoc-@param an die in 4b umbenannten Parameter angeglichen. Dabei behoben: - 4b hatte "tag" (HTML-Tag) als deutsches "Tag" gelesen und zu "dayValue" gemacht (makeElement, svg, Tagesübersicht) - zurück auf tag/day. - Aufgaben "InProgress" bekamen die Plakettenart "laufend", für die es nie eine CSS-Klasse gab - jetzt "success" wie laufende Instanzen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
da4ceac7d5
commit
837a634a22
@@ -4,18 +4,18 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Tools.Tests.FileRW;
|
||||
|
||||
/// <summary>
|
||||
/// S6 aus der Bestandsaufnahme: Die Pfadprüfung verglich nur Zeichenketten-Präfixe.
|
||||
/// Ohne abschließenden Verzeichnistrenner erlaubte ein Root "…\Workspace" damit auch
|
||||
/// S6 from the inventory: the path check only compared string prefixes.
|
||||
/// Without a trailing directory separator a root "…\Workspace" thus also allowed
|
||||
/// "…\Workspace-Backup\…".
|
||||
///
|
||||
/// Das Dateisystem wird hier bewusst NICHT abstrahiert — die Tests sollen die echte
|
||||
/// Pfadsemantik der jeweiligen Plattform prüfen (.., UNC, Alternate Data Streams,
|
||||
/// abschließende Punkte, unter Linux zusätzlich Groß-/Kleinschreibung und
|
||||
/// Verknüpfungen). Eine Abstraktion würde genau die Fehlerklasse verstecken, um die es
|
||||
/// geht.
|
||||
/// The file system is deliberately NOT abstracted here — the tests are supposed to check the real
|
||||
/// path semantics of the respective platform (.., UNC, alternate data streams,
|
||||
/// trailing dots, under Linux additionally upper/lower case and
|
||||
/// links). An abstraction would hide exactly the class of errors this is
|
||||
/// about.
|
||||
///
|
||||
/// Die Verzeichnisgrenze selbst prüft <c>PathBoundaryTests</c> in Core.Tests; hier geht
|
||||
/// es um das, was <see cref="WorkspacePath.Resolve"/> darüber hinaus abweist.
|
||||
/// The directory boundary itself is checked by <c>PathBoundaryTests</c> in Core.Tests; here it
|
||||
/// is about what <see cref="WorkspacePath.Resolve"/> rejects beyond that.
|
||||
/// </summary>
|
||||
public sealed class WorkspacePathTests : IDisposable
|
||||
{
|
||||
@@ -30,13 +30,13 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
public void Dispose()
|
||||
{
|
||||
try { Directory.Delete(Path.GetDirectoryName(_root)!, recursive: true); }
|
||||
catch { /* Aufräumen ist Nebensache */ }
|
||||
catch { /* Cleaning up is secondary */ }
|
||||
}
|
||||
|
||||
private string Resolve(string? relative) => WorkspacePath.Resolve(_root, relative, "personal");
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Ausbruchsversuche
|
||||
// Breakout attempts
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Theory]
|
||||
@@ -51,17 +51,17 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Die Windows-Formen müssen auch unter Linux abgewiesen werden — dort greift
|
||||
/// aber eine andere Regel: <c>Path.IsPathRooted(@"C:\temp\x")</c> ist unter Linux
|
||||
/// <c>false</c>, weil das schlicht ein Dateiname mit Doppelpunkt ist. Gefangen
|
||||
/// werden diese Fälle von der Zeichenregel: Doppelpunkt und Backslash sind im
|
||||
/// Pfad unzulässig, getrennt wird mit <c>/</c>. Das Ergebnis ist auf beiden
|
||||
/// Plattformen dasselbe, der Weg dorthin nicht.
|
||||
/// The Windows forms must be rejected under Linux too — but there a different
|
||||
/// rule applies: <c>Path.IsPathRooted(@"C:\temp\x")</c> is <c>false</c> under Linux,
|
||||
/// because that is simply a file name with a colon. These cases are caught
|
||||
/// by the character rule: colon and backslash are not permitted in the
|
||||
/// path, separation is done with <c>/</c>. The result is the same on both
|
||||
/// platforms, the way there is not.
|
||||
///
|
||||
/// Dieselbe Regel fängt unter Linux auch <c>@"..\..\evil.txt"</c> aus dem Test
|
||||
/// darüber. Ein Ausbruch war das dort nie — der Backslash trennt unter Linux
|
||||
/// nichts, die Datei wäre im Workspace gelandet —, aber der Test erwartete eine
|
||||
/// Abweisung und bekam keine.
|
||||
/// The same rule also catches <c>@"..\..\evil.txt"</c> from the test
|
||||
/// above under Linux. That was never a breakout there — the backslash separates
|
||||
/// nothing under Linux, the file would have landed in the workspace —, but the test expected a
|
||||
/// rejection and got none.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData(@"C:\Windows\System32\config\SAM")]
|
||||
@@ -74,9 +74,9 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Die Linux-Entsprechungen. Unter Windows sind das gewöhnliche relative Pfade,
|
||||
/// die entweder ins Leere zeigen oder von der <c>..</c>-Regel gefangen werden —
|
||||
/// deshalb laufen sie dort mit, statt übersprungen zu werden.
|
||||
/// The Linux equivalents. Under Windows these are ordinary relative paths
|
||||
/// that either point nowhere or are caught by the <c>..</c> rule —
|
||||
/// that's why they run along there instead of being skipped.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData("/etc/passwd")]
|
||||
@@ -92,12 +92,12 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
[InlineData("datei.txt:$DATA")]
|
||||
public void Alternate_Data_Streams_werden_abgelehnt(string path)
|
||||
{
|
||||
// Ein ADS umgeht sonst die Endungsprüfung: "x.txt:evil.exe".
|
||||
// An ADS would otherwise bypass the extension check: "x.txt:evil.exe".
|
||||
Should.Throw<UnauthorizedAccessException>(() => Resolve(path));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Der eigentliche Kern von S6: ein Nachbarverzeichnis mit gleichem Präfix.
|
||||
/// The actual core of S6: a neighboring directory with the same prefix.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Ein_Nachbarverzeichnis_mit_gleichem_Praefix_gilt_als_ausserhalb()
|
||||
@@ -117,7 +117,7 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Gegenproben — normale Nutzung muss funktionieren
|
||||
// Counter-checks — normal use must work
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Theory]
|
||||
@@ -155,7 +155,7 @@ public sealed class WorkspacePathTests : IDisposable
|
||||
[Fact]
|
||||
public void Ein_Unterverzeichnis_mit_aehnlichem_Namen_bleibt_innerhalb()
|
||||
{
|
||||
// Gegenprobe zur Präfix-Regel: Innerhalb des Roots ist alles erlaubt.
|
||||
// Counter-check to the prefix rule: within the root everything is allowed.
|
||||
var inner = Path.Combine(_root, "Workspace-Backup", "x.txt");
|
||||
|
||||
WorkspacePath.IsInside(inner, _root).ShouldBeTrue();
|
||||
|
||||
Reference in New Issue
Block a user