Files
pipu-music/services/api/internal/uploads/quality_test.go
T
mrleo1nidandCursor 066ba24834
ci / api / api (push) Successful in 40s
ci / db / db (push) Successful in 1m3s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Failing after 1m48s
ci / docker / docker (образы собираются — их сервер собирает сам при обновлении) (push) Successful in 46s
ci / ts / ts (packages + web) (push) Failing after 4m57s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 5m7s
feat: finish the upload, playback, and test gaps from the docs
Quality upgrades, batch covers, staging preview, and resume after reload are in the queue. Loudness and crossfade work on web and Android, and the documented checks now have suites.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-21 09:37:53 +03:00

22 lines
648 B
Go

package uploads
import "testing"
func TestBetterQuality(t *testing.T) {
if !BetterQuality("flac", "flac", 900000, "mp3", "mp3", 320000) {
t.Fatal("flac should replace mp3")
}
if BetterQuality("mp3", "mp3", 128000, "flac", "flac", 900000) {
t.Fatal("mp3 is not an upgrade over flac")
}
if !BetterQuality("mp3", "mp3", 320000, "mp3", "mp3", 128000) {
t.Fatal("much higher bitrate is an upgrade")
}
if BetterQuality("mp3", "mp3", 180000, "mp3", "mp3", 160000) {
t.Fatal("small bitrate step is not an upgrade")
}
if BetterQuality("flac", "flac", 0, "flac", "flac", 0) {
t.Fatal("same class without bitrate is not an upgrade")
}
}