summaryrefslogtreecommitdiff
path: root/tests/typ/structure
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/structure')
-rw-r--r--tests/typ/structure/desc.typ48
-rw-r--r--tests/typ/structure/enum.typ29
-rw-r--r--tests/typ/structure/list.typ2
3 files changed, 64 insertions, 15 deletions
diff --git a/tests/typ/structure/desc.typ b/tests/typ/structure/desc.typ
new file mode 100644
index 00000000..e12bbd16
--- /dev/null
+++ b/tests/typ/structure/desc.typ
@@ -0,0 +1,48 @@
+// Test description lists.
+
+---
+/
+No: list \
+/No: list
+
+---
+// Test with constructor.
+#desc(
+ (term: [One], body: [First]),
+ (term: [Two], body: [Second]),
+)
+
+---
+// Test joining.
+#for word in lorem(4).split().map(s => s.trim(".")) [
+ / #word: Latin stuff.
+]
+
+---
+// Test multiline.
+#set text(8pt)
+
+/ Fruit: A tasty, edible thing.
+/ Veggie:
+ An important energy source
+ for vegetarians.
+
+---
+// Test style change.
+#set text(8pt)
+
+/ First list: #lorem(4)
+#set desc(body-indent: 30pt)
+/ Second list: #lorem(4)
+
+---
+// Test grid like show rule.
+#show it: desc as table(
+ columns: 2,
+ padding: 3pt,
+ ..it.items.map(item => (emph(item.term), item.body)).flatten(),
+)
+
+/ A: One letter
+/ BB: Two letters
+/ CCC: Three letters
diff --git a/tests/typ/structure/enum.typ b/tests/typ/structure/enum.typ
index 7bd6fa88..eb1d9a9d 100644
--- a/tests/typ/structure/enum.typ
+++ b/tests/typ/structure/enum.typ
@@ -1,4 +1,4 @@
-// Test enums.
+// Test enumerations.
---
#enum[Embrace][Extend][Extinguish]
@@ -12,28 +12,28 @@
---
2. Second
1. First
- . Indented
+ + Indented
---
// Test automatic numbering in summed content.
#for i in range(5) {
- [. #roman(1 + i)]
+ [+ #roman(1 + i)]
}
---
// Test label pattern.
#set enum(label: "~ A:")
-. First
-. Second
+1. First
+ + Second
#set enum(label: "(*)")
-. A
-. B
-. C
++ A
++ B
++ C
#set enum(label: "i)")
-. A
-. B
++ A
++ B
---
// Test label closure.
@@ -47,12 +47,13 @@
---
#set enum(label: n => n > 1)
-. A
-. B
++ A
++ B
---
-// Lone dot is not a list.
-.
+// Lone plus is not an enum.
++
+No enum
---
// Error: 18-20 invalid pattern
diff --git a/tests/typ/structure/list.typ b/tests/typ/structure/list.typ
index 5c410a3f..9a021f31 100644
--- a/tests/typ/structure/list.typ
+++ b/tests/typ/structure/list.typ
@@ -1,4 +1,4 @@
-// Test lists.
+// Test unordered lists.
---
-