diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-04 22:14:57 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-04 22:14:57 +0200 |
| commit | e674fd7e909c273c36952f01829544a2efc11c92 (patch) | |
| tree | c74218ce4a546de06b28aad2f73ba460338252b7 /tests | |
| parent | 75472fee1a2377f56551fc856cf7511bd55091f0 (diff) | |
New raw theme & nicer debug representation
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/code/array.png | bin | 2534 -> 6191 bytes | |||
| -rw-r--r-- | tests/ref/code/call.png | bin | 3388 -> 2624 bytes | |||
| -rw-r--r-- | tests/ref/code/dict.png | bin | 1126 -> 1973 bytes | |||
| -rw-r--r-- | tests/ref/code/repr.png | bin | 32238 -> 30668 bytes | |||
| -rw-r--r-- | tests/ref/graphics/shape-rect.png | bin | 16331 -> 16279 bytes | |||
| -rw-r--r-- | tests/ref/text/code.png | bin | 0 -> 38850 bytes | |||
| -rw-r--r-- | tests/ref/text/edge.png | bin | 15857 -> 16107 bytes | |||
| -rw-r--r-- | tests/ref/text/par.png | bin | 30068 -> 30060 bytes | |||
| -rw-r--r-- | tests/ref/text/raw.png | bin | 22841 -> 18090 bytes | |||
| -rw-r--r-- | tests/typ/code/array.typ | 2 | ||||
| -rw-r--r-- | tests/typ/code/call.typ | 1 | ||||
| -rw-r--r-- | tests/typ/code/repr.typ | 15 | ||||
| -rw-r--r-- | tests/typ/text/code.typ | 57 | ||||
| -rw-r--r-- | tests/typ/text/microtype.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/raw.typ | 10 |
15 files changed, 68 insertions, 19 deletions
diff --git a/tests/ref/code/array.png b/tests/ref/code/array.png Binary files differindex 613aab97..cbda8aee 100644 --- a/tests/ref/code/array.png +++ b/tests/ref/code/array.png diff --git a/tests/ref/code/call.png b/tests/ref/code/call.png Binary files differindex eefc8cae..eaf77ad6 100644 --- a/tests/ref/code/call.png +++ b/tests/ref/code/call.png diff --git a/tests/ref/code/dict.png b/tests/ref/code/dict.png Binary files differindex 43cf1370..28e44999 100644 --- a/tests/ref/code/dict.png +++ b/tests/ref/code/dict.png diff --git a/tests/ref/code/repr.png b/tests/ref/code/repr.png Binary files differindex b6427518..b8beb09a 100644 --- a/tests/ref/code/repr.png +++ b/tests/ref/code/repr.png diff --git a/tests/ref/graphics/shape-rect.png b/tests/ref/graphics/shape-rect.png Binary files differindex 5ba78f97..2c2c7d7c 100644 --- a/tests/ref/graphics/shape-rect.png +++ b/tests/ref/graphics/shape-rect.png diff --git a/tests/ref/text/code.png b/tests/ref/text/code.png Binary files differnew file mode 100644 index 00000000..b012c2cf --- /dev/null +++ b/tests/ref/text/code.png diff --git a/tests/ref/text/edge.png b/tests/ref/text/edge.png Binary files differindex 0514d628..817e3300 100644 --- a/tests/ref/text/edge.png +++ b/tests/ref/text/edge.png diff --git a/tests/ref/text/par.png b/tests/ref/text/par.png Binary files differindex ae00ab45..6ee4aa9c 100644 --- a/tests/ref/text/par.png +++ b/tests/ref/text/par.png diff --git a/tests/ref/text/raw.png b/tests/ref/text/raw.png Binary files differindex e13293a6..2c101dcb 100644 --- a/tests/ref/text/raw.png +++ b/tests/ref/text/raw.png diff --git a/tests/typ/code/array.typ b/tests/typ/code/array.typ index cd163175..58b43ebf 100644 --- a/tests/typ/code/array.typ +++ b/tests/typ/code/array.typ @@ -4,6 +4,8 @@ --- // Ref: true +#set page(width: 150pt) + // Empty. {()} diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ index 55471774..5b8b5b05 100644 --- a/tests/typ/code/call.typ +++ b/tests/typ/code/call.typ @@ -13,7 +13,6 @@ #f(1)[2](3) // Don't parse this as a function. -// Should output `<function test> (it)`. #test (it) #let f(body) = body diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ index 8742f413..4d7a6cd5 100644 --- a/tests/typ/code/repr.typ +++ b/tests/typ/code/repr.typ @@ -25,23 +25,24 @@ {2.3fr} --- -// Colors. -#rgb("f7a20500") \ -{2pt + rgb("f7a20500")} +// Colors and strokes. +#set text(0.8em) +#rgb("f7a205") \ +{2pt + rgb("f7a205")} --- // Strings and escaping. -#repr("hi") \ +#raw(repr("hi"), lang: "typc") \ #repr("a\n[]\"\u{1F680}string") --- // Content. -#repr[*{"H" + "i"} there*] +#raw(repr[*{"H" + "i"} there*]) --- // Functions #let f(x) = x -{() => none} \ {f} \ -{rect} +{rect} \ +{() => none} \ diff --git a/tests/typ/text/code.typ b/tests/typ/text/code.typ new file mode 100644 index 00000000..4230dd87 --- /dev/null +++ b/tests/typ/text/code.typ @@ -0,0 +1,57 @@ +// Test code highlighting. + +--- +#set text(6pt) +```typ += Chapter 1 +#lorem(100) + +#let hi = "Hello World" +``` + +--- +#set page(width: 180pt) +#set text(6pt) + +```rust +/// A carefully designed state machine. +#[derive(Debug)] +enum State<'a> { A(u8), B(&'a str) } + +fn advance(state: State<'_>) -> State<'_> { + unimplemented!("state machine") +} +``` + +--- +#set text(6pt) +```py +import this + +def hi(): + print("Hi!") +``` + +--- +#set page(width: 180pt) +#set text(6pt) + +#rect(inset: (x: 4pt, y: 5pt), radius: 4pt, fill: rgb(239, 241, 243))[ + ```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> + ``` +] diff --git a/tests/typ/text/microtype.typ b/tests/typ/text/microtype.typ index 991e0d0d..28d29445 100644 --- a/tests/typ/text/microtype.typ +++ b/tests/typ/text/microtype.typ @@ -5,7 +5,7 @@ #set page(width: 130pt, margins: 15pt) #set par(justify: true, linebreaks: "simple") #set text(size: 9pt) -#rect(fill: rgb(repr(teal) + "00"), width: 100%)[ +#rect(fill: rgb(0, 0, 0, 0), width: 100%)[ This is a little bit of text that builds up to hang-ing hyphens and dash---es and then, you know, some punctuation in the margin. diff --git a/tests/typ/text/raw.typ b/tests/typ/text/raw.typ index 33b08568..cf497d75 100644 --- a/tests/typ/text/raw.typ +++ b/tests/typ/text/raw.typ @@ -37,16 +37,6 @@ The keyword ```rust let```. <``` 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 |
