summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-21 12:50:33 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-21 12:50:33 +0100
commitba294e2670814243122c9e4f560e0f21a4bec13d (patch)
tree36bdf987dc53729bb4a176713b40e2ca7c08a874 /tests
parent959df6da3b6e3c5876e9d5627cb2970e32a0a37f (diff)
Split up list type into three separate types and document them
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/compiler/construct.pngbin6043 -> 6118 bytes
-rw-r--r--tests/typ/basics/desc.typ8
-rw-r--r--tests/typ/basics/enum.typ20
-rw-r--r--tests/typ/basics/list.typ2
-rw-r--r--tests/typ/compiler/construct.typ8
-rw-r--r--tests/typ/compiler/set.typ2
6 files changed, 20 insertions, 20 deletions
diff --git a/tests/ref/compiler/construct.png b/tests/ref/compiler/construct.png
index 829b072b..aac79268 100644
--- a/tests/ref/compiler/construct.png
+++ b/tests/ref/compiler/construct.png
Binary files differ
diff --git a/tests/typ/basics/desc.typ b/tests/typ/basics/desc.typ
index 1bc92625..8147b400 100644
--- a/tests/typ/basics/desc.typ
+++ b/tests/typ/basics/desc.typ
@@ -8,8 +8,8 @@ No: list \
---
// Test with constructor.
#desc(
- (term: [One], body: [First]),
- (term: [Two], body: [Second]),
+ ([One], [First]),
+ ([Two], [Second]),
)
---
@@ -32,7 +32,7 @@ No: list \
#set text(8pt)
/ First list: #lorem(4)
-#set desc(body-indent: 30pt)
+#set desc(hanging-indent: 30pt)
/ Second list: #lorem(4)
---
@@ -40,7 +40,7 @@ No: list \
#show desc: it => table(
columns: 2,
padding: 3pt,
- ..it.items.map(item => (emph(item.term), item.body)).flatten(),
+ ..it.items.map(item => (emph(item(0)), item(1))).flatten(),
)
/ A: One letter
diff --git a/tests/typ/basics/enum.typ b/tests/typ/basics/enum.typ
index 0c62a2de..2bec3e9e 100644
--- a/tests/typ/basics/enum.typ
+++ b/tests/typ/basics/enum.typ
@@ -17,16 +17,16 @@
---
// Test label pattern.
-#set enum(label: "~ A:")
+#set enum(numbering: "~ A:")
1. First
+ Second
-#set enum(label: "(*)")
+#set enum(numbering: "(*)")
+ A
+ B
+ C
-#set enum(label: "i)")
+#set enum(numbering: "i)")
+ A
+ B
@@ -37,17 +37,17 @@
/ Desc: List
---
-// Test label closure.
+// Test numbering with closure.
#enum(
start: 4,
spacing: 0.65em - 3pt,
tight: false,
- label: n => text(fill: (red, green, blue)(mod(n, 3)), numbering("A", n)),
+ numbering: n => text(fill: (red, green, blue)(mod(n, 3)), numbering("A", n)),
[Red], [Green], [Blue],
)
---
-#set enum(label: n => n > 1)
+#set enum(numbering: n => n > 1)
+ A
+ B
@@ -57,9 +57,9 @@
No enum
---
-// Error: 18-20 invalid numbering pattern
-#set enum(label: "")
+// Error: 22-24 invalid numbering pattern
+#set enum(numbering: "")
---
-// Error: 18-24 invalid numbering pattern
-#set enum(label: "(())")
+// Error: 22-28 invalid numbering pattern
+#set enum(numbering: "(())")
diff --git a/tests/typ/basics/list.typ b/tests/typ/basics/list.typ
index 9ed5993a..4a948131 100644
--- a/tests/typ/basics/list.typ
+++ b/tests/typ/basics/list.typ
@@ -48,6 +48,6 @@ _Shopping list_
- B with 2 tabs
---
-#set list(label: [-])
+#set list(marker: [-])
- Bare hyphen
- is not a list
diff --git a/tests/typ/compiler/construct.typ b/tests/typ/compiler/construct.typ
index df5368b7..3ed8fed3 100644
--- a/tests/typ/compiler/construct.typ
+++ b/tests/typ/compiler/construct.typ
@@ -10,8 +10,8 @@
// Ensure that constructor styles win, but not over outer styles.
// The outer paragraph should be right-aligned,
// but the B should be center-aligned.
-#set list(label: [>])
-#list(label: [--])[
+#set list(marker: [>])
+#list(marker: [--])[
#rect(width: 2cm, fill: conifer, inset: 4pt, list[A])
]
@@ -27,5 +27,5 @@ A #rect(fill: yellow, inset: 5pt, rect()) B
---
// The constructor property should still work
// when there are recursive show rules.
-#show list: set text(blue)
-#list(label: "(a)", [A], list[B])
+#show enum: set text(blue)
+#enum(numbering: "(a)", [A], enum[B])
diff --git a/tests/typ/compiler/set.typ b/tests/typ/compiler/set.typ
index fc5053b1..7414ad5e 100644
--- a/tests/typ/compiler/set.typ
+++ b/tests/typ/compiler/set.typ
@@ -39,7 +39,7 @@ Hello *{x}*
---
// Test relative path resolving in layout phase.
#let choice = ("monkey.svg", "rhino.png", "tiger.jpg")
-#set enum(label: n => {
+#set enum(numbering: n => {
let path = "../../res/" + choice(n - 1)
move(dy: -0.15em, image(path, width: 1em, height: 1em))
})