Files
FWS-Kitty/kittens/icat/scaling_test.go
T
BlackAngelTV 3d174c45a4 chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
2026-11-04 11:35:59 +01:00

30 lines
579 B
Go

package icat
import (
"fmt"
"image"
"testing"
)
var _ = fmt.Print
func TestScaling(t *testing.T) {
for _, tc := range []struct {
w, h, pw, ph, ew, eh int
}{
{1000, 50, 800, 600, 800, 40},
{1000, 50, 800000, 600, 12000, 600},
{100, 50, 800, 600, 800, 400},
{1920, 1080, 800, 600, 800, 450},
{300, 900, 800, 600, 200, 600},
{400, 300, 800, 600, 800, 600},
} {
aw, ah := scale_up(tc.w, tc.h, tc.pw, tc.ph)
actual := image.Pt(aw, ah)
expected := image.Pt(tc.ew, tc.eh)
if actual != expected {
t.Fatalf("want: %v got: %v", expected, actual)
}
}
}