diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-29 13:37:25 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-29 14:18:13 +0100 |
| commit | 0efe669278a5e1c3f2985eba2f3360e91159c54a (patch) | |
| tree | 502712857c48f0decb5e698257c0a96d358a436e /tests/typ/structure | |
| parent | 836692e73cff0356e409a9ba5b4887b86809d4ca (diff) | |
Reorganize library and tests
Diffstat (limited to 'tests/typ/structure')
| -rw-r--r-- | tests/typ/structure/attach.typ | 54 | ||||
| -rw-r--r-- | tests/typ/structure/desc.typ | 48 | ||||
| -rw-r--r-- | tests/typ/structure/enum.typ | 65 | ||||
| -rw-r--r-- | tests/typ/structure/heading.typ | 52 | ||||
| -rw-r--r-- | tests/typ/structure/list.typ | 53 | ||||
| -rw-r--r-- | tests/typ/structure/table.typ | 22 |
6 files changed, 0 insertions, 294 deletions
diff --git a/tests/typ/structure/attach.typ b/tests/typ/structure/attach.typ deleted file mode 100644 index 9d043eb0..00000000 --- a/tests/typ/structure/attach.typ +++ /dev/null @@ -1,54 +0,0 @@ -// Test list attaching. - ---- -// Test basic attached list. -Attached to: -- the bottom -- of the paragraph - -Next paragraph. - ---- -// Test that attached list isn't affected by block spacing. -#show list: set block(above: 100pt) -Hello -- A -World -- B - ---- -// Test non-attached list followed by attached list, -// separated by only word. -Hello - -- A - -World -- B - ---- -// Test non-attached tight list. -#set block(spacing: 15pt) -Hello -- A -World - -- B -- C - -More. - ---- -// Test that wide lists cannot be ... -#set block(spacing: 15pt) -Hello -- A - -- B -World - ---- -// ... even if forced to. -Hello -#list(tight: false)[A][B] -World diff --git a/tests/typ/structure/desc.typ b/tests/typ/structure/desc.typ deleted file mode 100644 index 1bc92625..00000000 --- a/tests/typ/structure/desc.typ +++ /dev/null @@ -1,48 +0,0 @@ -// 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 desc: it => 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 deleted file mode 100644 index d4c30385..00000000 --- a/tests/typ/structure/enum.typ +++ /dev/null @@ -1,65 +0,0 @@ -// Test enumerations. - ---- -#enum[Embrace][Extend][Extinguish] - ---- -1. First. - 2. Indented - -+ Second - ---- -// Test automatic numbering in summed content. -#for i in range(5) { - [+ #numbering(1 + i, "I")] -} - ---- -// Test label pattern. -#set enum(label: "~ A:") -1. First - + Second - -#set enum(label: "(*)") -+ A -+ B -+ C - -#set enum(label: "i)") -+ A -+ B - ---- -// Mix of different lists -- List -+ Enum -/ Desc: List - ---- -// Test label closure. -#enum( - start: 4, - spacing: 0.65em - 3pt, - tight: false, - label: n => text(fill: (red, green, blue)(mod(n, 3)), numbering(n, "A")), - [Red], [Green], [Blue], -) - ---- -#set enum(label: n => n > 1) -+ A -+ B - ---- -// Lone plus is not an enum. -+ -No enum - ---- -// Error: 18-20 invalid numbering pattern -#set enum(label: "") - ---- -// Error: 18-24 invalid numbering pattern -#set enum(label: "(())") diff --git a/tests/typ/structure/heading.typ b/tests/typ/structure/heading.typ deleted file mode 100644 index 9fd4e648..00000000 --- a/tests/typ/structure/heading.typ +++ /dev/null @@ -1,52 +0,0 @@ -// Test headings. - ---- -#show heading: it => text(blue, it.body) - -= -No heading - ---- -// Different number of equals signs. - -= Level 1 -== Level 2 -=== Level 3 - -// After three, it stops shrinking. -=========== Level 11 - ---- -// Heading vs. no heading. - -// Parsed as headings if at start of the context. -/**/ = Level 1 -{[== Level 2]} -#box[=== Level 3] - -// Not at the start of the context. -No = heading - -// Escaped. -\= No heading - ---- -// Blocks can continue the heading. - -= [This -is -multiline. -] - -= This - is not. - ---- -// Test styling. -#show heading.where(level: 5): it => block( - text(family: "Roboto", fill: eastern, it.body + [!]) -) - -= Heading -===== Heading 🌍 -#heading(level: 5)[Heading] diff --git a/tests/typ/structure/list.typ b/tests/typ/structure/list.typ deleted file mode 100644 index 9ed5993a..00000000 --- a/tests/typ/structure/list.typ +++ /dev/null @@ -1,53 +0,0 @@ -// Test unordered lists. - ---- -- -No list - ---- -_Shopping list_ -#list[Apples][Potatoes][Juice] - ---- -- First level. - - - Second level. - There are multiple paragraphs. - - - Third level. - - Still the same bullet point. - - - Still level 2. - -- At the top. - ---- -- Level 1 - - Level [ -2 through content block -] - ---- - - Top-level indent -- is fine. - ---- - - A - - B - - C -- D - ---- -// This works because tabs are used consistently. - - A with 1 tab - - B with 2 tabs - -// This doesn't work because of mixed tabs and spaces. - - A with 2 spaces - - B with 2 tabs - ---- -#set list(label: [-]) -- Bare hyphen -- is not a list diff --git a/tests/typ/structure/table.typ b/tests/typ/structure/table.typ deleted file mode 100644 index 527141c5..00000000 --- a/tests/typ/structure/table.typ +++ /dev/null @@ -1,22 +0,0 @@ -// Test tables. - ---- -#set page(height: 70pt) -#set table(fill: (x, y) => if even(x + y) { rgb("aaa") }) - -#table( - columns: (1fr,) * 3, - stroke: 2pt + rgb("333"), - [A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H], -) - ---- -#table(columns: 3, stroke: none, fill: green, [A], [B], [C]) - ---- -// Ref: false -#table() - ---- -// Error: 14-19 expected color or none or function, found string -#table(fill: "hey") |
