summaryrefslogtreecommitdiff
path: root/tests/suite/model/list.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-13 10:39:45 +0200
committerGitHub <noreply@github.com>2024-04-13 08:39:45 +0000
commit020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch)
treec0027ad22046e2726c22298461327823d6b88d53 /tests/suite/model/list.typ
parent72dd79210602ecc799726fc096b078afbb47f299 (diff)
Better test runner (#3922)
Diffstat (limited to 'tests/suite/model/list.typ')
-rw-r--r--tests/suite/model/list.typ147
1 files changed, 147 insertions, 0 deletions
diff --git a/tests/suite/model/list.typ b/tests/suite/model/list.typ
new file mode 100644
index 00000000..e37fa65d
--- /dev/null
+++ b/tests/suite/model/list.typ
@@ -0,0 +1,147 @@
+// Test bullet lists.
+
+--- list-basic ---
+_Shopping list_
+#list[Apples][Potatoes][Juice]
+
+--- list-nested ---
+- First level.
+
+ - Second level.
+ There are multiple paragraphs.
+
+ - Third level.
+
+ Still the same bullet point.
+
+ - Still level 2.
+
+- At the top.
+
+--- list-content-block ---
+- Level 1
+ - Level #[
+2 through content block
+]
+
+--- list-top-level-indent ---
+ - Top-level indent
+- is fine.
+
+--- list-indent-specifics ---
+ - A
+ - B
+ - C
+- D
+
+--- list-tabs ---
+// This works because tabs are used consistently.
+ - A with 1 tab
+ - B with 2 tabs
+
+--- list-mixed-tabs-and-spaces ---
+// This doesn't work because of mixed tabs and spaces.
+ - A with 2 spaces
+ - B with 2 tabs
+
+--- list-syntax-edge-cases ---
+// Edge cases.
+-
+Not in list
+-Nope
+
+--- list-marker-align-unaffected ---
+// Alignment shouldn't affect marker
+#set align(horizon)
+
+- ABCDEF\ GHIJKL\ MNOPQR
+
+--- list-marker-dash ---
+// Test en-dash.
+#set list(marker: [--])
+- A
+- B
+
+--- list-marker-cycle ---
+// Test that items are cycled.
+#set list(marker: ([--], [•]))
+- A
+ - B
+ - C
+
+--- list-marker-closure ---
+// Test function.
+#set list(marker: n => if n == 1 [--] else [•])
+- A
+- B
+ - C
+ - D
+ - E
+- F
+
+--- list-marker-bare-hyphen ---
+// Test that bare hyphen doesn't lead to cycles and crashes.
+#set list(marker: [-])
+- Bare hyphen is
+- a bad marker
+
+--- list-marker-array-empty ---
+// Error: 19-21 array must contain at least one marker
+#set list(marker: ())
+
+--- list-attached ---
+// Test basic attached list.
+Attached to:
+- the bottom
+- of the paragraph
+
+Next paragraph.
+
+--- list-attached-above-spacing ---
+// Test that attached list isn't affected by block spacing.
+#show list: set block(above: 100pt)
+Hello
+- A
+World
+- B
+
+--- list-non-attached-followed-by-attached ---
+// Test non-attached list followed by attached list,
+// separated by only word.
+Hello
+
+- A
+
+World
+- B
+
+--- list-tight-non-attached-tight ---
+// Test non-attached tight list.
+#set block(spacing: 15pt)
+Hello
+- A
+World
+
+- B
+- C
+
+More.
+
+--- list-wide-cannot-attach ---
+// Test that wide lists cannot be ...
+#set block(spacing: 15pt)
+Hello
+- A
+
+- B
+World
+
+--- list-wide-really-cannot-attach ---
+// ... even if forced to.
+Hello
+#list(tight: false)[A][B]
+World
+
+--- issue-2530-list-item-panic ---
+// List item (pre-emptive)
+#list.item[Hello]