diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-30 18:04:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-30 18:49:19 +0200 |
| commit | 1ee1d078e2480ddd08d40915bc7a74a8352acff0 (patch) | |
| tree | 1e7ff367278a19fead3e404cf06d65bfb80a6cd9 /tests/typ/text | |
| parent | 42a27b48df427edf8dbb624c51551a90ecf2e7ea (diff) | |
Fatal errors
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free
- Parsing still recovers and can produce multiple errors
- Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import)
- The single error that could occur during execution is removed for now
- Removes Value::Error variant
Diffstat (limited to 'tests/typ/text')
| -rw-r--r-- | tests/typ/text/decorations.typ | 31 | ||||
| -rw-r--r-- | tests/typ/text/font.typ | 26 | ||||
| -rw-r--r-- | tests/typ/text/whitespace.typ | 6 |
3 files changed, 38 insertions, 25 deletions
diff --git a/tests/typ/text/decorations.typ b/tests/typ/text/decorations.typ index 3741dc19..83b04650 100644 --- a/tests/typ/text/decorations.typ +++ b/tests/typ/text/decorations.typ @@ -1,19 +1,34 @@ // Test text decorations. --- -#strike[Statements dreamt up by the utterly deranged.] - -Sometimes, we work #strike(10pt, extent: 5%)[in secret]. -There might be #strike(stroke: rgb("abcdef88"), thickness: 10pt, extent: 5%)[redacted] -things. +// Basic strikethrough. +#strike[ + Statements dreamt up by the utterly deranged. +] +// Move underline down. #underline(offset: 5pt)[Further below.] ---- +// Different color. #underline(rgb("fc0030"))[Critical information is conveyed here.] -#underline[Still important, but not #underline(0pt)[mission ]critical.] +// Inherits font color. #font(fill: rgb("fc0030"), underline[Change with the wind.]) ---- +// Both over- and underline. #overline(underline[Running amongst the wolves.]) + +// Disable underline by setting it back to 0pt. +#underline[Still important, but not #underline(0pt)[mission ]critical.] + +--- +#let redact = strike with (10pt, extent: 5%) +#let highlight = strike with ( + stroke: rgb("abcdef88"), + thickness: 10pt, + extent: 5%, +) + +// Abuse thickness and transparency for redacting and highlighting stuff. +Sometimes, we work #redact[in secret]. +There might be #highlight[redacted] things. diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index 0f64e244..cc906fbc 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -54,21 +54,25 @@ Emoji: 🐪, 🌋, 🏞 #font(monospace, monospace: ("Nope", "Latin Modern Math"))[Math.] --- -// Ref: false - // Error: 7-12 unexpected argument #font(false)[] +--- // Error: 14-18 expected font style, found font weight -// Error: 28-34 expected font weight, found string -// Error: 43-44 expected string or array of strings, found integer -#font(style: bold, weight: "thin", serif: 0)[] +#font(style: bold, weight: "thin")[] -// Error: 7-27 unexpected argument -#font(something: "invalid")[] +--- +// Error: 14-15 expected string or array of strings, found integer +#font(serif: 0)[] -// Error: 13-23 unexpected argument -#font(12pt, size: 10pt)[] +--- +// Error: 19-23 unexpected argument +#font(size: 10pt, 12pt)[] -// Error: 16-35 unexpected argument -#font("Arial", family: "Helvetica")[] +--- +// Error: 28-35 unexpected argument +#font(family: "Helvetica", "Arial")[] + +--- +// Error: 7-27 unexpected argument +#font(something: "invalid")[] diff --git a/tests/typ/text/whitespace.typ b/tests/typ/text/whitespace.typ index 418c3a12..c81513fa 100644 --- a/tests/typ/text/whitespace.typ +++ b/tests/typ/text/whitespace.typ @@ -2,16 +2,12 @@ --- // Spacing around let. - -// Error: 6 expected identifier -A#let;B \ A#let x = 1;B #test(x, 1) \ A #let x = 2;B #test(x, 2) \ A#let x = 3; B #test(x, 3) --- // Spacing around if-else. - A#if true [B]C \ A#if true [B] C \ A #if true{"B"}C \ @@ -21,7 +17,6 @@ A#if true [B] #else [] C --- // Spacing around while loop. - #let c = true; A#while c [{c = false}B]C \ #let c = true; A#while c [{c = false}B] C \ #let c = true; A #while c { c = false; "B" }C \ @@ -29,7 +24,6 @@ A#if true [B] #else [] C --- // Spacing around for loop. - A#for _ in (none,) [B]C \ A#for _ in (none,) [B] C \ A #for _ in (none,) {"B"}C |
