summaryrefslogtreecommitdiff
path: root/tests/typ/structure
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-30 14:12:28 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-30 14:12:28 +0200
commitf9e115daf54c29358f890b137f50a33a781af680 (patch)
tree496de52246629ea8039db6beea94eb779ed2851d /tests/typ/structure
parentf7c67cde72e6a67f45180856b332bae9863243bd (diff)
New block spacing model
Diffstat (limited to 'tests/typ/structure')
-rw-r--r--tests/typ/structure/attach.typ56
-rw-r--r--tests/typ/structure/enum.typ3
-rw-r--r--tests/typ/structure/heading.typ9
-rw-r--r--tests/typ/structure/list.typ11
4 files changed, 65 insertions, 14 deletions
diff --git a/tests/typ/structure/attach.typ b/tests/typ/structure/attach.typ
new file mode 100644
index 00000000..c6d3c28c
--- /dev/null
+++ b/tests/typ/structure/attach.typ
@@ -0,0 +1,56 @@
+// Test list attaching.
+
+---
+// Test basic attached list.
+Attached to:
+- the bottom
+- of the paragraph
+
+Next paragraph.
+
+---
+// Test attached list without parbreak after it.
+// Ensures the par spacing is used below by setting
+// super high around spacing.
+#set list(around: 100pt)
+Hello
+- A
+World
+- B
+
+---
+// Test non-attached list followed by attached list,
+// separated by only word.
+Hello
+
+- A
+
+World
+- B
+
+---
+// Test not-attached tight list.
+#set list(around: 15pt)
+Hello
+- A
+World
+
+- B
+- C
+
+More.
+
+---
+// Test that wide lists cannot be attached ...
+#set list(around: 15pt, spacing: 15pt)
+Hello
+- A
+
+- B
+World
+
+---
+// ... unless really forced to.
+Hello
+#list(attached: true, tight: false)[A][B]
+World
diff --git a/tests/typ/structure/enum.typ b/tests/typ/structure/enum.typ
index c4d178ce..b1045ee2 100644
--- a/tests/typ/structure/enum.typ
+++ b/tests/typ/structure/enum.typ
@@ -39,7 +39,8 @@
// Test label closure.
#enum(
start: 4,
- spacing: -3pt,
+ spacing: 0.65em - 3pt,
+ tight: false,
label: n => text(fill: (red, green, blue)(mod(n, 3)), [#upper(letter(n))]),
[Red], [Green], [Blue],
)
diff --git a/tests/typ/structure/heading.typ b/tests/typ/structure/heading.typ
index f4ba5f33..de95c35b 100644
--- a/tests/typ/structure/heading.typ
+++ b/tests/typ/structure/heading.typ
@@ -1,14 +1,13 @@
// Test headings.
---
-// Different number of hashtags.
+// Different number of equals signs.
-// Valid levels.
= Level 1
-=== Level 2
-====== Level 6
+== Level 2
+=== Level 3
-// At some point, it should stop shrinking.
+// After three, it stops shrinking.
=========== Level 11
---
diff --git a/tests/typ/structure/list.typ b/tests/typ/structure/list.typ
index 52cd51be..77e153c7 100644
--- a/tests/typ/structure/list.typ
+++ b/tests/typ/structure/list.typ
@@ -2,21 +2,16 @@
---
_Shopping list_
-#list[Apples][Potatoes][Juice]
-
----
-Tightly
-- surrounded
-- by two
-paragraphs.
+#list(attached: true)[Apples][Potatoes][Juice]
---
- First level.
- Second level.
-
There are multiple paragraphs.
+
- Third level.
+
Still the same bullet point.
- Still level 2.