summaryrefslogtreecommitdiff
path: root/tests/suite/text
diff options
context:
space:
mode:
Diffstat (limited to 'tests/suite/text')
-rw-r--r--tests/suite/text/raw.typ153
-rw-r--r--tests/suite/text/smartquote.typ19
2 files changed, 86 insertions, 86 deletions
diff --git a/tests/suite/text/raw.typ b/tests/suite/text/raw.typ
index 0de34962..d6f6978e 100644
--- a/tests/suite/text/raw.typ
+++ b/tests/suite/text/raw.typ
@@ -127,8 +127,6 @@ Year Month Day
#set page(width: 180pt)
#set text(6pt)
-#lorem(20)
-
```py
def something(x):
return x
@@ -137,28 +135,47 @@ a = 342395823859823958329
b = 324923
```
-#lorem(20)
-
--- raw-align-specified ---
// Text inside raw block should follow the specified alignment.
#set page(width: 180pt)
#set text(6pt)
-#lorem(20)
#align(center, raw(
lang: "typ",
block: true,
align: right,
"#let f(x) = x\n#align(center, line(length: 1em))",
))
-#lorem(20)
--- raw-align-invalid ---
// Error: 17-20 expected `start`, `left`, `center`, `right`, or `end`, found top
#set raw(align: top)
+--- raw-inline-multiline ---
+#set page(width: 180pt)
+#set text(6pt)
+#set raw(lang:"python")
+
+Inline raws, multiline e.g. `for i in range(10):
+ # Only this line is a comment.
+ print(i)` or otherwise e.g. `print(j)`, are colored properly.
+
+Inline raws, multiline e.g. `
+# Appears blocky due to linebreaks at the boundary.
+for i in range(10):
+ print(i)
+` or otherwise e.g. `print(j)`, are colored properly.
+
--- raw-highlight-typ ---
-// LARGE
+```typ
+= Chapter 1
+#lorem(100)
+
+#let hi = "Hello World"
+#show heading: emph
+```
+
+--- raw-highlight-typc ---
#set page(width: auto)
```typ
@@ -184,45 +201,35 @@ b = 324923
#{ hello }
#{ hello() }
#{ hello.world() }
-$ hello $
-$ hello() $
-$ box[] $
-$ hello.world $
-$ hello.world() $
-$ hello.my.world() $
-$ f_zeta(x), f_zeta(x)/1 $
-$ emph(hello.my.world()) $
-$ emph(hello.my().world) $
-$ emph(hello.my().world()) $
-$ #hello $
-$ #hello() $
-$ #hello.world $
-$ #hello.world() $
-$ #box[] $
#if foo []
```
---- raw-highlight ---
-#set page(width: 180pt)
-#set text(6pt)
-#show raw: it => rect(
- width: 100%,
- inset: (x: 4pt, y: 5pt),
- radius: 4pt,
- fill: rgb(239, 241, 243),
- place(right, text(luma(110), it.lang)) + it,
-)
-
-```typ
-= Chapter 1
-#lorem(100)
-
-#let hi = "Hello World"
-#show heading: emph
+--- raw-highlight-typm ---
+#set page(width: auto)
+```typm
+1 + 2/3
+a^b
+hello
+hello()
+box[]
+hello.world
+hello.world()
+hello.my.world()
+f_zeta(x), f_zeta(x)/1
+emph(hello.my.world())
+emph(hello.my().world)
+emph(hello.my().world())
+#hello
+#hello()
+#hello.world
+#hello.world()
+#box[]
```
+--- raw-highlight-rust ---
+#set page(width: auto)
```rust
-/// A carefully designed state machine.
+/// A state machine.
#[derive(Debug)]
enum State<'a> { A(u8), B(&'a str) }
@@ -231,6 +238,9 @@ fn advance(state: State<'_>) -> State<'_> {
}
```
+--- raw-highlight-py ---
+#set page(width: auto)
+
```py
import this
@@ -238,6 +248,9 @@ def hi():
print("Hi!")
```
+--- raw-highlight-cpp ---
+#set page(width: auto)
+
```cpp
#include <iostream>
@@ -246,46 +259,26 @@ int main() {
}
```
-```julia
-# Add two numbers
-function add(x, y)
- return x * y
-end
-```
-
- // Try with some indent.
- ```html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <h1>Topic</h1>
- <p>The Hypertext Markup Language.</p>
- <script>
- function foo(a, b) {
- return a + b + "string";
- }
- </script>
- </body>
- </html>
- ```
-
---- raw-inline-multiline ---
-#set page(width: 180pt)
-#set text(6pt)
-#set raw(lang:"python")
-
-Inline raws, multiline e.g. `for i in range(10):
- # Only this line is a comment.
- print(i)` or otherwise e.g. `print(j)`, are colored properly.
+--- raw-highlight-html ---
+#set page(width: auto)
-Inline raws, multiline e.g. `
-# Appears blocky due to linebreaks at the boundary.
-for i in range(10):
- print(i)
-` or otherwise e.g. `print(j)`, are colored properly.
+```html
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <h1>Topic</h1>
+ <p>The Hypertext Markup Language.</p>
+ <script>
+ function foo(a, b) {
+ return a + b + "string";
+ }
+ </script>
+ </body>
+</html>
+```
--- raw-blocky ---
// Test various raw parsing edge cases.
@@ -448,8 +441,8 @@ test
)
#for c in cases {
- assert.eq(c.text, c.input.text, message: "in point " + c.name + ", expect " + repr(c.text) + ", got " + repr(c.input.text) + "")
let block = c.at("block", default: false)
+ assert.eq(c.text, c.input.text, message: "in point " + c.name + ", expect " + repr(c.text) + ", got " + repr(c.input.text) + "")
assert.eq(block, c.input.block, message: "in point " + c.name + ", expect " + repr(block) + ", got " + repr(c.input.block) + "")
}
diff --git a/tests/suite/text/smartquote.typ b/tests/suite/text/smartquote.typ
index 04a82036..f5442ffd 100644
--- a/tests/suite/text/smartquote.typ
+++ b/tests/suite/text/smartquote.typ
@@ -1,48 +1,55 @@
--- smartquote ---
-// LARGE
-#set page(width: 250pt)
-
-// Test simple quotations in various languages.
#set text(lang: "en")
"The horse eats no cucumber salad" was the first sentence ever uttered on the 'telephone.'
+--- smartquote-de ---
#set text(lang: "de")
"Das Pferd frisst keinen Gurkensalat" war der erste jemals am 'Fernsprecher' gesagte Satz.
+--- smartquote-de-ch ---
#set text(lang: "de", region: "CH")
"Das Pferd frisst keinen Gurkensalat" war der erste jemals am 'Fernsprecher' gesagte Satz.
+--- smartquote-es ---
#set text(lang: "es", region: none)
"El caballo no come ensalada de pepino" fue la primera frase pronunciada por 'teléfono'.
+--- smartquote-es-mx ---
#set text(lang: "es", region: "MX")
"El caballo no come ensalada de pepino" fue la primera frase pronunciada por 'teléfono'.
-#set text(lang: "fr", region: none)
+--- smartquote-fr ---
+#set text(lang: "fr")
"Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'.
+--- smartquote-fi ---
#set text(lang: "fi")
"Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause.
+--- smartquote-gr ---
#set text(lang: "gr")
"Το άλογο δεν τρώει αγγουροσαλάτα" ήταν η πρώτη πρόταση που ειπώθηκε στο 'τηλέφωνο'.
+--- smartquote-he ---
#set text(lang: "he")
"הסוס לא אוכל סלט מלפפונים" היה המשפט ההראשון שנאמר ב'טלפון'.
+--- smartquote-ro ---
#set text(lang: "ro")
"Calul nu mănâncă salată de castraveți" a fost prima propoziție rostită vreodată la 'telefon'.
+--- smartquote-ru ---
#set text(lang: "ru")
"Лошадь не ест салат из огурцов" - это была первая фраза, сказанная по 'телефону'.
+--- smartquote-it ---
#set text(lang: "it")
"Il cavallo non mangia insalata di cetrioli" è stata la prima frase pronunciata al 'telefono'.
+--- smartquote-la ---
#set text(lang: "la")
#set smartquote(alternative: true)
"Equus cucumeris sem non edit" prima sententia in 'telephono' prolata fuit.
-#set smartquote(alternative: false)
--- smartquote-empty ---
// Test single pair of quotes.