diff options
| author | +merlan #flirora <uruwi@protonmail.com> | 2024-05-30 03:58:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-30 07:58:07 +0000 |
| commit | b15aa664f2aa5f25cdf81e0f3bf277938383cf59 (patch) | |
| tree | 0ff9d37e595367901795d970caa6818b479e580c /tests | |
| parent | 702271dacb205d43f91736386e5575590f2c3af2 (diff) | |
Allow `measure` to accept available size (#4264)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/suite/layout/measure.typ | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/suite/layout/measure.typ b/tests/suite/layout/measure.typ index 5f82e915..10c3c818 100644 --- a/tests/suite/layout/measure.typ +++ b/tests/suite/layout/measure.typ @@ -7,3 +7,16 @@ } #text(10pt, f(6pt, 8pt)) #text(20pt, f(13pt, 14pt)) + +--- measure-given-area --- +// Test `measure` given an area. +#let text = lorem(100) + +#context { + let d1 = measure(text) + assert(d1.width > 2000pt) + assert(d1.height < 10pt) + let d2 = measure(width: 400pt, height: auto, text) + assert(d2.width < 400pt) + assert(d2.height > 50pt) +} |
