优化结构

This commit is contained in:
Yvan
2026-08-22 23:02:44 +08:00
parent b18baf1547
commit 64459574b2
16 changed files with 158 additions and 73 deletions
@@ -100,6 +100,15 @@ func TestNormalizeDeletePrefix(t *testing.T) {
}
}
func TestBoundedPrefixKeepsDirectoryBoundary(t *testing.T) {
if got := boundedPrefix("uploads/chunks/1", "uploads/chunks/1/"); got != "uploads/chunks/1/" {
t.Fatalf("boundedPrefix() = %q", got)
}
if got := boundedPrefix("uploads/chunks/1", "uploads/chunks/1"); got != "uploads/chunks/1" {
t.Fatalf("boundedPrefix() changed ordinary prefix to %q", got)
}
}
func TestAdvanceDeletePrefixCursor(t *testing.T) {
if _, err := advanceDeletePrefixCursor("cursor", "cursor", true); err == nil {
t.Fatal("same cursor should fail")