Prepare verified laboratory 6 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 470d9d6f1e
commit 7d56e52fd0
335 changed files with 31206 additions and 72 deletions
@@ -0,0 +1,12 @@
package imagefile
import "testing"
func TestFitDimensionsPreservesAspectAndDoesNotUpscale(t *testing.T) {
for _, c := range []struct{ w, h, max, wantW, wantH int }{{320, 200, 256, 256, 160}, {1, 1, 256, 1, 1}, {1, 400, 256, 1, 256}, {400, 1, 256, 256, 1}, {200, 320, 256, 160, 256}, {1280, 1280, 1280, 1280, 1280}} {
w, h := FitDimensions(c.w, c.h, c.max)
if w != c.wantW || h != c.wantH {
t.Errorf("%+v: got %dx%d", c, w, h)
}
}
}