Add settings, cloud places, and optional archive-content indexing.
Keep official clients in charge of sync while Explorer can group locations, persist UI prefs, and list zip/rar/7z members without extracting them. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,6 +43,9 @@ public class PathRulesTests
|
||||
Assert.Equal(@"Windows\System32", PathRules.MakeRelative(@"C:\", @"C:\Windows\System32"));
|
||||
Assert.Equal(@"C:\Windows", PathRules.Parent(@"C:\Windows\System32"));
|
||||
Assert.Equal(@"C:\", PathRules.Parent(@"C:\Windows"));
|
||||
Assert.Equal(@"pack.zip\docs", PathRules.RelativeParent(@"pack.zip\docs\a.txt"));
|
||||
Assert.Equal("pack.zip", PathRules.RelativeParent(@"pack.zip\docs"));
|
||||
Assert.Equal("", PathRules.RelativeParent("pack.zip"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -62,6 +65,31 @@ public class PathRulesTests
|
||||
}
|
||||
}
|
||||
|
||||
public class ArchiveFormatsTests
|
||||
{
|
||||
[Fact]
|
||||
public void Detects_common_archive_extensions()
|
||||
{
|
||||
Assert.True(ArchiveFormats.IsArchive("pack.zip"));
|
||||
Assert.True(ArchiveFormats.IsArchive("film.7z"));
|
||||
Assert.True(ArchiveFormats.IsArchive("backup.rar"));
|
||||
Assert.True(ArchiveFormats.IsArchive("src.tar.gz"));
|
||||
Assert.True(ArchiveFormats.IsZipFamily("photos.cbz"));
|
||||
Assert.False(ArchiveFormats.IsArchive("notes.txt"));
|
||||
Assert.False(ArchiveFormats.IsArchive("report.docx"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rejects_unsafe_archive_entry_paths()
|
||||
{
|
||||
Assert.True(ArchiveFormats.TryNormalizeEntryPath("docs/a.txt", out var ok));
|
||||
Assert.Equal(@"docs\a.txt", ok);
|
||||
Assert.False(ArchiveFormats.TryNormalizeEntryPath(@"..\escape.txt", out _));
|
||||
Assert.False(ArchiveFormats.TryNormalizeEntryPath(@"C:\abs.txt", out _));
|
||||
Assert.False(ArchiveFormats.TryNormalizeEntryPath("/", out _));
|
||||
}
|
||||
}
|
||||
|
||||
public class VolumeIdentityTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user