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/text | |
| parent | b63c21c91d99a1554a019dc275f955d3e6a34271 (diff) | |
Reorganize library
Diffstat (limited to 'tests/typ/text')
| -rw-r--r-- | tests/typ/text/deco.typ (renamed from tests/typ/text/decorations.typ) | 0 | ||||
| -rw-r--r-- | tests/typ/text/emph-strong.typ | 33 | ||||
| -rw-r--r-- | tests/typ/text/escape.typ | 38 | ||||
| -rw-r--r-- | tests/typ/text/linebreak.typ (renamed from tests/typ/text/linebreaks.typ) | 2 | ||||
| -rw-r--r-- | tests/typ/text/link.typ (renamed from tests/typ/text/links.typ) | 0 | ||||
| -rw-r--r-- | tests/typ/text/raw.typ | 59 | ||||
| -rw-r--r-- | tests/typ/text/shorthands.typ | 8 |
7 files changed, 139 insertions, 1 deletions
diff --git a/tests/typ/text/decorations.typ b/tests/typ/text/deco.typ index e0693ca3..e0693ca3 100644 --- a/tests/typ/text/decorations.typ +++ b/tests/typ/text/deco.typ diff --git a/tests/typ/text/emph-strong.typ b/tests/typ/text/emph-strong.typ new file mode 100644 index 00000000..9bdb5059 --- /dev/null +++ b/tests/typ/text/emph-strong.typ @@ -0,0 +1,33 @@ +// 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/text/escape.typ b/tests/typ/text/escape.typ new file mode 100644 index 00000000..6ec469c1 --- /dev/null +++ b/tests/typ/text/escape.typ @@ -0,0 +1,38 @@ +// 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/text/linebreaks.typ b/tests/typ/text/linebreak.typ index 25a8c5ab..ff8559d6 100644 --- a/tests/typ/text/linebreaks.typ +++ b/tests/typ/text/linebreak.typ @@ -1,4 +1,4 @@ -// Test line breaking special cases. +// Test line breaks. --- // Test overlong word that is not directly after a hard break. diff --git a/tests/typ/text/links.typ b/tests/typ/text/link.typ index 99037ee3..99037ee3 100644 --- a/tests/typ/text/links.typ +++ b/tests/typ/text/link.typ diff --git a/tests/typ/text/raw.typ b/tests/typ/text/raw.typ new file mode 100644 index 00000000..0e053a9b --- /dev/null +++ b/tests/typ/text/raw.typ @@ -0,0 +1,59 @@ +// 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/text/shorthands.typ b/tests/typ/text/shorthands.typ new file mode 100644 index 00000000..ef0bf866 --- /dev/null +++ b/tests/typ/text/shorthands.typ @@ -0,0 +1,8 @@ +// Test shorthands for unicode codepoints. + +--- +The non-breaking~space does work. + +--- +- En dash: -- +- Em dash: --- |
