merged from gramsrv upstream

This commit is contained in:
onysd 2026-09-01 12:06:31 +03:00
parent 79c64ee916
commit 21a0856587
651 changed files with 54774 additions and 4590 deletions

View file

@ -6,8 +6,17 @@ import (
"github.com/iamxvbaba/td/tg"
"github.com/iamxvbaba/td/tgerr"
"telesrv/internal/domain"
)
func TestFileSaveErrMapsStorageCapacityWithoutFloodWait(t *testing.T) {
err := fileSaveErr(domain.ErrStorageFull)
if !tgerr.Is(err, "STORAGE_FULL") {
t.Fatalf("fileSaveErr = %v, want STORAGE_FULL", err)
}
}
func TestStorageFileTypePrefersMagicOverMime(t *testing.T) {
webp := []byte{'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P'}
if _, ok := storageFileType("image/jpeg", webp).(*tg.StorageFileWebp); !ok {