diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-13 16:50:57 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-13 16:50:57 +0100 |
| commit | 8f68bc7a8ea619af12d95bec7025bd9f3a86625f (patch) | |
| tree | 7f9b454ed419b45d7787de4ace992b40078d4072 /tests/typ/basics | |
| parent | b1b4e52af9e2da8f8ae1fc17a81ed6cbcbb8f525 (diff) | |
Dissolve basics folder
Diffstat (limited to 'tests/typ/basics')
| -rw-r--r-- | tests/typ/basics/enum.typ | 69 | ||||
| -rw-r--r-- | tests/typ/basics/heading.typ | 53 | ||||
| -rw-r--r-- | tests/typ/basics/list-attach.typ | 54 | ||||
| -rw-r--r-- | tests/typ/basics/list.typ | 56 | ||||
| -rw-r--r-- | tests/typ/basics/table.typ | 22 | ||||
| -rw-r--r-- | tests/typ/basics/terms.typ | 52 |
6 files changed, 0 insertions, 306 deletions
diff --git a/tests/typ/basics/enum.typ b/tests/typ/basics/enum.typ deleted file mode 100644 index fd845c2b..00000000 --- a/tests/typ/basics/enum.typ +++ /dev/null @@ -1,69 +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("I", 1 + i)] -} - ---- -// Test label pattern. -#set enum(numbering: "~ A:") -1. First - + Second - -#set enum(numbering: "(*)") -+ A -+ B -+ C - -#set enum(numbering: "i)") -+ A -+ B - ---- -// Mix of different lists -- Bullet List -+ Numbered List -/ Term: List - ---- -// Test numbering with closure. -#enum( - start: 4, - spacing: 0.65em - 3pt, - tight: false, - numbering: n => text( - fill: (red, green, blue).at(calc.mod(n, 3)), - numbering("A", n), - ), - [Red], [Green], [Blue], -) - ---- -#set enum(numbering: n => n > 1) -+ A -+ B - ---- -// Edge cases. -+ -Empty -+Nope - ---- -// Error: 22-24 invalid numbering pattern -#set enum(numbering: "") - ---- -// Error: 22-28 invalid numbering pattern -#set enum(numbering: "(())") diff --git a/tests/typ/basics/heading.typ b/tests/typ/basics/heading.typ deleted file mode 100644 index 3d637036..00000000 --- a/tests/typ/basics/heading.typ +++ /dev/null @@ -1,53 +0,0 @@ -// Test headings. - ---- -// 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.title + [!]) -) - -= Heading -===== Heading 🌍 -#heading(level: 5)[Heading] - ---- -// Edge cases. -#set heading(numbering: "1.") -= -Not in heading -=Nope diff --git a/tests/typ/basics/list-attach.typ b/tests/typ/basics/list-attach.typ deleted file mode 100644 index 9d043eb0..00000000 --- a/tests/typ/basics/list-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/basics/list.typ b/tests/typ/basics/list.typ deleted file mode 100644 index 3fd9ddb1..00000000 --- a/tests/typ/basics/list.typ +++ /dev/null @@ -1,56 +0,0 @@ -// Test bullet lists. - ---- -_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(marker: [-]) -- Bare hyphen -- is not a list - ---- -// Edge cases. -- -Not in list --Nope diff --git a/tests/typ/basics/table.typ b/tests/typ/basics/table.typ deleted file mode 100644 index 5d423e03..00000000 --- a/tests/typ/basics/table.typ +++ /dev/null @@ -1,22 +0,0 @@ -// Test tables. - ---- -#set page(height: 70pt) -#set table(fill: (x, y) => if calc.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, none, or function, found string -#table(fill: "hey") diff --git a/tests/typ/basics/terms.typ b/tests/typ/basics/terms.typ deleted file mode 100644 index 57864423..00000000 --- a/tests/typ/basics/terms.typ +++ /dev/null @@ -1,52 +0,0 @@ -// Test term list. - ---- -// Test with constructor. -#terms( - ([One], [First]), - ([Two], [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 terms(hanging-indent: 30pt) -/ Second list: #lorem(4) - ---- -// Test grid like show rule. -#show terms: it => table( - columns: 2, - inset: 3pt, - ..it.items.map(item => (emph(item.at(0)), item.at(1))).flatten(), -) - -/ A: One letter -/ BB: Two letters -/ CCC: Three letters - ---- -/ Term: -Not in list -/Nope - ---- -// Error: 8 expected colon -/ Hello |
