package app import "testing" func TestRoundedDuration(t *testing.T) { tests := []struct { ms int64 min int up bool want int64 }{ {37 * 60_000, 15, false, 30 * 60_000}, {38 * 60_000, 15, false, 45 * 60_000}, {37 * 60_000, 15, true, 45 * 60_000}, {37 * 60_000, 1, false, 37 * 60_000}, } for _, tt := range tests { if got := roundedDuration(tt.ms, tt.min, tt.up); got != tt.want { t.Errorf("roundedDuration(%d,%d,%v)=%d want %d", tt.ms, tt.min, tt.up, got, tt.want) } } }