mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
test: add tests for counter in rowspan grid layout cells
This commit is contained in:
parent
6be80f3d66
commit
a783e94daf
BIN
tests/ref/grid-rtl-rowspan-counter-equal.png
Normal file
BIN
tests/ref/grid-rtl-rowspan-counter-equal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 272 B |
BIN
tests/ref/grid-rtl-rowspan-counter-unequal-1.png
Normal file
BIN
tests/ref/grid-rtl-rowspan-counter-unequal-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 360 B |
BIN
tests/ref/grid-rtl-rowspan-counter-unequal-2.png
Normal file
BIN
tests/ref/grid-rtl-rowspan-counter-unequal-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 375 B |
@ -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()
|
||||
]),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user