1package pdfexport23import "testing"45func TestStandardCellFontSizeBounds(t *testing.T) {6 tests := []struct {7 name string8 cellSize float649 scale float6410 want float6411 }{12 {13 name: "clamps low",14 cellSize: 3.0,15 scale: 0.6,16 want: 8.2,17 },18 {19 name: "keeps in range",20 cellSize: 10.0,21 scale: 0.6,22 want: 9.0,23 },24 {25 name: "clamps high",26 cellSize: 20.0,27 scale: 0.7,28 want: 11.2,29 },30 }3132 for _, tt := range tests {33 t.Run(tt.name, func(t *testing.T) {34 got := standardCellFontSize(tt.cellSize, tt.scale)35 if got != tt.want {36 t.Fatalf("font size = %.3f, want %.3f", got, tt.want)37 }38 })39 }40}4142func TestClampStandardCellFontSizeBounds(t *testing.T) {43 tests := []struct {44 name string45 in float6446 want float6447 }{48 {49 name: "below min",50 in: 3.9,51 want: 8.2,52 },53 {54 name: "in range",55 in: 6.5,56 want: 8.2,57 },58 {59 name: "above max",60 in: 9.1,61 want: 9.1,62 },63 }6465 for _, tt := range tests {66 t.Run(tt.name, func(t *testing.T) {67 got := clampStandardCellFontSize(tt.in)68 if got != tt.want {69 t.Fatalf("clamp = %.3f, want %.3f", got, tt.want)70 }71 })72 }73}