diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-04-13 10:39:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-13 08:39:45 +0000 |
| commit | 020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch) | |
| tree | c0027ad22046e2726c22298461327823d6b88d53 /tests/suite/layout/repeat.typ | |
| parent | 72dd79210602ecc799726fc096b078afbb47f299 (diff) | |
Better test runner (#3922)
Diffstat (limited to 'tests/suite/layout/repeat.typ')
| -rw-r--r-- | tests/suite/layout/repeat.typ | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/suite/layout/repeat.typ b/tests/suite/layout/repeat.typ new file mode 100644 index 00000000..5c82fc19 --- /dev/null +++ b/tests/suite/layout/repeat.typ @@ -0,0 +1,44 @@ +// Test the `repeat` function. + +--- repeat-basic --- +// Test multiple repeats. +#let sections = ( + ("Introduction", 1), + ("Approach", 1), + ("Evaluation", 3), + ("Discussion", 15), + ("Related Work", 16), + ("Conclusion", 253), +) + +#for section in sections [ + #section.at(0) #box(width: 1fr, repeat[.]) #section.at(1) \ +] + +--- repeat-dots-rtl --- +// Test dots with RTL. +#set text(lang: "ar") +مقدمة #box(width: 1fr, repeat[.]) 15 + +--- repeat-empty --- +// Test empty repeat. +A #box(width: 1fr, repeat[]) B + +--- repeat-unboxed --- +// Test unboxed repeat. +#repeat(rect(width: 2em, height: 1em)) + +--- repeat-align-and-dir --- +// Test single repeat in both directions. +A#box(width: 1fr, repeat(rect(width: 6em, height: 0.7em)))B + +#set align(center) +A#box(width: 1fr, repeat(rect(width: 6em, height: 0.7em)))B + +#set text(dir: rtl) +ريجين#box(width: 1fr, repeat(rect(width: 4em, height: 0.7em)))سون + +--- repeat-unrestricted --- +// Error: 2:2-2:13 repeat with no size restrictions +#set page(width: auto) +#repeat(".") |
