From a783e94daff3b8b7acc09dd1a901268677f4a759 Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Fri, 2 May 2025 20:29:14 +0200 Subject: [PATCH] test: add tests for counter in rowspan grid layout cells --- tests/ref/grid-rtl-rowspan-counter-equal.png | Bin 0 -> 272 bytes .../grid-rtl-rowspan-counter-unequal-1.png | Bin 0 -> 360 bytes .../grid-rtl-rowspan-counter-unequal-2.png | Bin 0 -> 375 bytes tests/suite/layout/grid/rtl.typ | 70 ++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/ref/grid-rtl-rowspan-counter-equal.png create mode 100644 tests/ref/grid-rtl-rowspan-counter-unequal-1.png create mode 100644 tests/ref/grid-rtl-rowspan-counter-unequal-2.png diff --git a/tests/ref/grid-rtl-rowspan-counter-equal.png b/tests/ref/grid-rtl-rowspan-counter-equal.png new file mode 100644 index 0000000000000000000000000000000000000000..fb0df44ad40da59bfc8ee7d98b1445de8c70d3a3 GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^6+o=Y0VEjK$QP*tsq3CDjv*Ddl7HAcG$dYm6xi*q zE4Q@*#5lR}$N9$H%qfMZf+Rj4Ul(fcY4Y(nv{N3;QLEU8< zD>nBvMb>BE7Z5$5uXcuyIY=aW&y(;2^ACqNtodcEuP&Tic=DpR>E*9$tG7JM57}9D*9cp;sUck_{3~S`;=krMT5lXeI?g1rAn75JqAY#E}hMh4fD= zC^+cO&ie+z?dM&b1i$a}Y@h83(4ztZ3oNj}0t@U0HjmUE!Qs3;_5Ce_?o#hv!=wuK zihQl6>8f)7fd@FckmckGXtEc_L7yA(I=im`bB7+_HGM<*t? z%Ra)5fn1g$4O)w}(6^5;`niq?aHm*uAOZ_4u)qTUGx!I#s*xWevRUx}0000Omm+ZHB)-Nr{C>U&*AalQXYW?7Fb|`1-1j1_R}uGJ*ybKC$QFMM6(SO zTsPK5%QV*NVtCI!>+qI2`1tN*P>0F(m;Z9= zff!hTUxM=;`ub7|*oRjNt)+uY0CfU0jmDDgY`y~BnS0eX9Gwl`62AsA<71DQ=-eM2 zNoyZa^7_09`CI}EEU+8!S+h$pwE&=P4?Q^v=Tde02%%^W!aH-jRj7*qfwrQ9aAT1M z%4L8bCEy@jlcC<&N1YDBlfBE;;iUy&D%lrz5auTLK&1lYPxJD*1Qu9efd&5e@Gm}K Vi?9~Xi!J~F002ovPDHLkV1lKlreXj9 literal 0 HcmV?d00001 diff --git a/tests/suite/layout/grid/rtl.typ b/tests/suite/layout/grid/rtl.typ index 866c8257b..971c5198f 100644 --- a/tests/suite/layout/grid/rtl.typ +++ b/tests/suite/layout/grid/rtl.typ @@ -213,3 +213,73 @@ #context test.get().first() ], ) + +--- grid-rtl-rowspan-counter-equal --- +// Test interaction between RTL and counters +#set text(dir: rtl) +#let test = counter("test") +#grid( + columns: (1fr, 1fr), + inset: 5pt, + align: center, + grid.cell(rowspan: 2, [ + a: // should produce 1 + #test.step() + #context test.get().first() + ]), + grid.cell(rowspan: 2, [ + b: // should produce 2 + #test.step() + #context test.get().first() + ]), +) + +--- grid-rtl-rowspan-counter-unequal-1 --- +// Test interaction between RTL and counters +#set text(dir: rtl) +#let test = counter("test") +#grid( + columns: (1fr, 1fr), + inset: 5pt, + align: center, + grid.cell(rowspan: 1, [ + a: // should produce 1 + #test.step() + #context test.get().first() + ]), + grid.cell(rowspan: 2, [ + b: // should produce 2 + #test.step() + #context test.get().first() + ]), + grid.cell(rowspan: 1, [ + c: // should produce 3 + #test.step() + #context test.get().first() + ]), +) + +--- grid-rtl-rowspan-counter-unequal-2 --- +// Test interaction between RTL and counters +#set text(dir: rtl) +#let test = counter("test") +#grid( + columns: (1fr, 1fr), + inset: 5pt, + align: center, + grid.cell(rowspan: 2, [ + a: // should produce 1 + #test.step() + #context test.get().first() + ]), + grid.cell(rowspan: 1, [ + b: // should produce 2 + #test.step() + #context test.get().first() + ]), + grid.cell(rowspan: 1, [ + d: // should produce 3 + #test.step() + #context test.get().first() + ]), +)