fix(05): WR-05 gate public file serving on is_public
This commit is contained in:
@@ -37,6 +37,19 @@ func TestFileIsPublicDefaultsTrue(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestThumbFileID(t *testing.T) {
|
||||
id, ok := thumbFileID("thumb_42_200_200_0_0_crop.jpg")
|
||||
if !ok || id != 42 {
|
||||
t.Fatalf("thumb id = %d ok=%v, want 42 true", id, ok)
|
||||
}
|
||||
if _, ok := thumbFileID("abc123xyz.jpg"); ok {
|
||||
t.Fatal("original disk_name must not parse as a thumb id")
|
||||
}
|
||||
if _, ok := thumbFileID("thumb_x_200_200_0_0_crop.jpg"); ok {
|
||||
t.Fatal("non-numeric thumb id must be rejected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFileSelfRegisters(t *testing.T) {
|
||||
for _, m := range All() {
|
||||
switch m.(type) {
|
||||
|
||||
Reference in New Issue
Block a user