Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:28:51 +01:00
1 parent 7b6db17870
commit 0295eb1ad2
125 files changed
+59376

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
package display_test
import (
"testing"
"git.maze.io/go/harmon/display"
)
func TestParseSize(t *testing.T) {
testCases := []struct {
Test string
DefaultWidth int
DefaultHeight int
Width int
Height int
}{
{"", 128, 64, 128, 64},
{"x32", 128, 64, 128, 32},
{"64x", 128, 64, 64, 64},
{"123x456", 128, 64, 123, 456},
}
for _, test := range testCases {
t.Run(test.Test, func(it *testing.T) {
w, h, err := display.ParseSize(test.Test, test.DefaultWidth, test.DefaultHeight)
if err != nil {
it.Fatal(err)
}
if w != test.Width {
it.Errorf("expected %q to return width %d, got %d", test.Test, test.Width, w)
}
if h != test.Height {
it.Errorf("expected %q to return height %d, got %d", test.Test, test.Height, h)
}
})
}
}