summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/grid-rtl-counter.pngbin0 -> 272 bytes
-rw-r--r--tests/ref/grid-rtl-rowspan-counter-equal.pngbin0 -> 272 bytes
-rw-r--r--tests/ref/grid-rtl-rowspan-counter-mixed-1.pngbin0 -> 360 bytes
-rw-r--r--tests/ref/grid-rtl-rowspan-counter-mixed-2.pngbin0 -> 361 bytes
-rw-r--r--tests/ref/grid-rtl-rowspan-counter-unequal-1.pngbin0 -> 361 bytes
-rw-r--r--tests/ref/grid-rtl-rowspan-counter-unequal-2.pngbin0 -> 360 bytes
-rw-r--r--tests/suite/layout/grid/rtl.typ140
7 files changed, 140 insertions, 0 deletions
diff --git a/tests/ref/grid-rtl-counter.png b/tests/ref/grid-rtl-counter.png
new file mode 100644
index 00000000..fb0df44a
--- /dev/null
+++ b/tests/ref/grid-rtl-counter.png
Binary files differ
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 00000000..fb0df44a
--- /dev/null
+++ b/tests/ref/grid-rtl-rowspan-counter-equal.png
Binary files differ
diff --git a/tests/ref/grid-rtl-rowspan-counter-mixed-1.png b/tests/ref/grid-rtl-rowspan-counter-mixed-1.png
new file mode 100644
index 00000000..fffccc56
--- /dev/null
+++ b/tests/ref/grid-rtl-rowspan-counter-mixed-1.png
Binary files differ
diff --git a/tests/ref/grid-rtl-rowspan-counter-mixed-2.png b/tests/ref/grid-rtl-rowspan-counter-mixed-2.png
new file mode 100644
index 00000000..c091f3a8
--- /dev/null
+++ b/tests/ref/grid-rtl-rowspan-counter-mixed-2.png
Binary files differ
diff --git a/tests/ref/grid-rtl-rowspan-counter-unequal-1.png b/tests/ref/grid-rtl-rowspan-counter-unequal-1.png
new file mode 100644
index 00000000..c091f3a8
--- /dev/null
+++ b/tests/ref/grid-rtl-rowspan-counter-unequal-1.png
Binary files differ
diff --git a/tests/ref/grid-rtl-rowspan-counter-unequal-2.png b/tests/ref/grid-rtl-rowspan-counter-unequal-2.png
new file mode 100644
index 00000000..fffccc56
--- /dev/null
+++ b/tests/ref/grid-rtl-rowspan-counter-unequal-2.png
Binary files differ
diff --git a/tests/suite/layout/grid/rtl.typ b/tests/suite/layout/grid/rtl.typ
index 7c0e999a..e79b465a 100644
--- a/tests/suite/layout/grid/rtl.typ
+++ b/tests/suite/layout/grid/rtl.typ
@@ -193,3 +193,143 @@
),
..range(0, 10).map(i => ([\##i], table.cell(stroke: green)[123], table.cell(stroke: blue)[456], [789], [?], table.hline(start: 4, end: 5, stroke: red))).flatten()
)
+
+--- grid-rtl-counter ---
+// Test interaction between RTL and counters
+#set text(dir: rtl)
+#let test = counter("test")
+#grid(
+ columns: (1fr, 1fr),
+ inset: 5pt,
+ align: center,
+ [
+ a: // should produce 1
+ #test.step()
+ #context test.get().first()
+ ],
+ [
+ b: // should produce 2
+ #test.step()
+ #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: 5, [
+ b: // will produce 2
+ #test.step()
+ #context test.get().first()
+ ]),
+ grid.cell(rowspan: 2, [
+ a: // will produce 1
+ #test.step()
+ #context test.get().first()
+ ]),
+ grid.cell(rowspan: 3, [
+ c: // will 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: // will produce 1
+ #test.step()
+ #context test.get().first()
+ ]),
+ grid.cell(rowspan: 5, [
+ b: // will produce 2
+ #test.step()
+ #context test.get().first()
+ ]),
+ grid.cell(rowspan: 3, [
+ c: // will produce 3
+ #test.step()
+ #context test.get().first()
+ ]),
+)
+
+--- grid-rtl-rowspan-counter-mixed-1 ---
+// Test interaction between RTL and counters
+#set text(dir: rtl)
+#let test = counter("test")
+#grid(
+ columns: (1fr, 1fr),
+ inset: 5pt,
+ align: center,
+ [
+ a: // will produce 1
+ #test.step()
+ #context test.get().first()
+ ],
+ grid.cell(rowspan: 2, [
+ b: // will produce 2
+ #test.step()
+ #context test.get().first()
+ ]),
+ [
+ c: // will produce 3
+ #test.step()
+ #context test.get().first()
+ ],
+)
+
+--- grid-rtl-rowspan-counter-mixed-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, [
+ b: // will produce 2
+ #test.step()
+ #context test.get().first()
+ ]),
+ [
+ a: // will produce 1
+ #test.step()
+ #context test.get().first()
+ ],
+ [
+ c: // will produce 3
+ #test.step()
+ #context test.get().first()
+ ]
+)