diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-28 15:50:48 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-28 23:54:34 +0100 |
| commit | 3ca5b238238e1128aa7bbfbd5db9e632045d8600 (patch) | |
| tree | 2471f4b340a15695b7f4d518c0b39fabaea676c4 /tests/typ/markup | |
| parent | b63c21c91d99a1554a019dc275f955d3e6a34271 (diff) | |
Reorganize library
Diffstat (limited to 'tests/typ/markup')
| -rw-r--r-- | tests/typ/markup/emph-strong.typ | 33 | ||||
| -rw-r--r-- | tests/typ/markup/enums.typ | 60 | ||||
| -rw-r--r-- | tests/typ/markup/escape.typ | 38 | ||||
| -rw-r--r-- | tests/typ/markup/heading.typ | 50 | ||||
| -rw-r--r-- | tests/typ/markup/linebreak.typ | 4 | ||||
| -rw-r--r-- | tests/typ/markup/lists.typ | 51 | ||||
| -rw-r--r-- | tests/typ/markup/math.typ | 12 | ||||
| -rw-r--r-- | tests/typ/markup/raw.typ | 59 | ||||
| -rw-r--r-- | tests/typ/markup/shorthands.typ | 8 |
9 files changed, 0 insertions, 315 deletions
diff --git a/tests/typ/markup/emph-strong.typ b/tests/typ/markup/emph-strong.typ deleted file mode 100644 index 9bdb5059..00000000 --- a/tests/typ/markup/emph-strong.typ +++ /dev/null @@ -1,33 +0,0 @@ -// Test emph and strong. - ---- -// Basic. -_Emphasized and *strong* words!_ - -// Inside of a word it's a normal underscore or star. -hello_world Nutzer*innen - -// Can contain paragraph in child template. -_Still [ - -] emphasized._ - ---- -// Inside of words can still use the functions. -P#strong[art]ly em#emph[phas]ized. - ---- -// Error: 13 expected underscore -#box[_Scoped] to body. - ---- -// Ends at paragraph break. -// Error: 7 expected underscore -_Hello - -World - ---- -// Error: 1:12 expected star -// Error: 2:1 expected star -_Cannot *be_ interleaved* diff --git a/tests/typ/markup/enums.typ b/tests/typ/markup/enums.typ deleted file mode 100644 index 8ba3cea6..00000000 --- a/tests/typ/markup/enums.typ +++ /dev/null @@ -1,60 +0,0 @@ -// Test enums. - ---- -. Embrace -. Extend -. Extinguish - ---- -1. First. - 2. Second. - -1. Back to first. - ---- -2. Second -1. First - . Indented - ---- -// Test automatic numbering in summed templates. -#for i in range(5) { - [. #roman(1 + i)] -} - ---- -// Test label pattern. -#set enum(label: "~ A:") -. First -. Second - -#set enum(label: "(*)") -. A -. B -. C - -#set enum(label: "i)") -. A -. B - ---- -// Test label closure. -#enum( - start: 4, - spacing: -3pt, - label: n => text(fill: (red, green, blue)(mod(n, 3)), [#upper(letter(n))]), - [Red], [Green], [Blue], -) - ---- -// Error: 18-20 invalid pattern -#set enum(label: "") - ---- -// Error: 18-24 invalid pattern -#set enum(label: "(())") - ---- -// Error: 18-28 expected template, found boolean -#set enum(label: n => false) -. A diff --git a/tests/typ/markup/escape.typ b/tests/typ/markup/escape.typ deleted file mode 100644 index 6ec469c1..00000000 --- a/tests/typ/markup/escape.typ +++ /dev/null @@ -1,38 +0,0 @@ -// Test escape sequences. - ---- -// Escapable symbols. -\\ \/ \[ \] \{ \} \# \* \_ \= \~ \` \$ - -// No need to escape. -( ) ; < > - -// Unescapable. -\a \: \; \( \) - -// Escaped comments. -\// -\/\* \*\/ -\/* \*/ * - -// Unicode escape sequence. -\u{1F3D5} == 🏕 - -// Escaped escape sequence. -\u{41} vs. \\u\{41\} - -// Some code stuff in text. -let f() , ; : | + - /= == 12 "string" - -// Escaped dot. -10\. May - ---- -// Unicode codepoint does not exist. -// Error: 1-11 invalid unicode escape sequence -\u{FFFFFF} - ---- -// Unterminated. -// Error: 6 expected closing brace -\u{41[*Bold*] diff --git a/tests/typ/markup/heading.typ b/tests/typ/markup/heading.typ deleted file mode 100644 index 2ae97aa8..00000000 --- a/tests/typ/markup/heading.typ +++ /dev/null @@ -1,50 +0,0 @@ -// Test headings. - ---- -// Different number of hashtags. - -// Valid levels. -= Level 1 -=== Level 2 -====== Level 6 - -// At some point, it should stop 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 - ---- -// While indented at least as much as the start, the heading continues. - -= This - is - indented. - -= This -is not. - -// Code blocks continue heading. -= A { - "B" -} - ---- -// Test styling. -= Heading - -#set heading(family: "Roboto", fill: eastern) - -===== Heading 🌍 -#heading(level: 5)[Heading] diff --git a/tests/typ/markup/linebreak.typ b/tests/typ/markup/linebreak.typ deleted file mode 100644 index 7fe8a718..00000000 --- a/tests/typ/markup/linebreak.typ +++ /dev/null @@ -1,4 +0,0 @@ -// Test line breaks. - ---- -A \ B \ C diff --git a/tests/typ/markup/lists.typ b/tests/typ/markup/lists.typ deleted file mode 100644 index 38fc2c63..00000000 --- a/tests/typ/markup/lists.typ +++ /dev/null @@ -1,51 +0,0 @@ -// Test lists. - ---- -_Shopping list_ -- Apples -- Potatoes -- Juice - ---- -Tightly -- surrounded -- by two -paragraphs. - ---- -- 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 template -] - ---- - - 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 diff --git a/tests/typ/markup/math.typ b/tests/typ/markup/math.typ deleted file mode 100644 index cad01d10..00000000 --- a/tests/typ/markup/math.typ +++ /dev/null @@ -1,12 +0,0 @@ -// Test math formulas. - ---- -The sum of $a$ and $b$ is $a + b$. - ---- -We will show that: -$[ a^2 + b^2 = c^2 ]$ - ---- -// Error: 2:1 expected closing bracket and dollar sign -$[a diff --git a/tests/typ/markup/raw.typ b/tests/typ/markup/raw.typ deleted file mode 100644 index 0e053a9b..00000000 --- a/tests/typ/markup/raw.typ +++ /dev/null @@ -1,59 +0,0 @@ -// Test raw blocks. - ---- -// No extra space. -`A``B` - ---- -// Typst syntax inside. -`#let x = 1` \ -`#f(1)` - ---- -// Multiline block splits paragraphs. - -First -``` -Second -``` -Third - ---- -// Lots of backticks inside. -```` -```backticks``` -```` - ---- -// Trimming. - -// Space between "rust" and "let" is trimmed. -The keyword ```rust let```. - -// Trimming depends on number backticks. -<``> \ -<` untrimmed `> \ -<``` trimmed` ```> \ -<``` trimmed ```> \ -<``` trimmed```> - -// Multiline trimming and dedenting. -#block[ - ```py - import this - - def hi(): - print("Hi!") - ``` -] - ---- -// First line is not dedented and leading space is still possible. - ``` A - B - C``` - ---- -// Unterminated. -// Error: 2:1 expected 1 backtick -`endless diff --git a/tests/typ/markup/shorthands.typ b/tests/typ/markup/shorthands.typ deleted file mode 100644 index ef0bf866..00000000 --- a/tests/typ/markup/shorthands.typ +++ /dev/null @@ -1,8 +0,0 @@ -// Test shorthands for unicode codepoints. - ---- -The non-breaking~space does work. - ---- -- En dash: -- -- Em dash: --- |
