package encoder import ( "strings" "testing" ) func TestSvtav1Params(t *testing.T) { const base = "film-grain=10:film-grain-denoise=1:scd=1:qm-min=4:qm-max=15:keyint=10s" if got := svtav1Params(0); got != base { t.Errorf("lp=0 should not append lp:\n got %q\nwant %q", got, base) } if got := svtav1Params(-1); got != base { t.Errorf("lp<0 should not append lp: got %q", got) } if got := svtav1Params(4); got != base+":lp=4" { t.Errorf("lp=4: got %q, want suffix :lp=4", got) } if got := svtav1Params(4); !strings.HasPrefix(got, base) { t.Errorf("lp set should keep the base params intact: got %q", got) } }