diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-12-27 20:45:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-12-27 20:45:20 +0100 |
| commit | ba3d43f7b2a18984be27f3d472884a19f3adce4c (patch) | |
| tree | 1c6ffa31145fb69c19319440969d2037b27b584f /tests/typ | |
| parent | 750d220bb080be077cd7ede6d18d485b1c3fb0c9 (diff) | |
Refresh function call and dictionary syntax
- No colon between function name and arguments, just whitespace
- "Named" arguments (previously "keyword" arguments) use colon instead of equals sign
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/example-coma.typ | 14 | ||||
| -rw-r--r-- | tests/typ/func-font-error.typ | 14 | ||||
| -rw-r--r-- | tests/typ/func-font-fallback.typ | 10 | ||||
| -rw-r--r-- | tests/typ/func-font-properties.typ | 14 | ||||
| -rw-r--r-- | tests/typ/func-h-and-v.typ | 14 | ||||
| -rw-r--r-- | tests/typ/func-image-error.typ | 8 | ||||
| -rw-r--r-- | tests/typ/func-image-fit.typ | 16 | ||||
| -rw-r--r-- | tests/typ/func-image-formats.typ | 4 | ||||
| -rw-r--r-- | tests/typ/func-page-body.typ | 2 | ||||
| -rw-r--r-- | tests/typ/func-page-dirs.typ | 2 | ||||
| -rw-r--r-- | tests/typ/func-page-error.typ | 6 | ||||
| -rw-r--r-- | tests/typ/func-page-metrics.typ | 22 | ||||
| -rw-r--r-- | tests/typ/func-pagebreak.typ | 2 | ||||
| -rw-r--r-- | tests/typ/func-rgb.typ | 16 |
14 files changed, 72 insertions, 72 deletions
diff --git a/tests/typ/example-coma.typ b/tests/typ/example-coma.typ index d41032c1..d559a6fb 100644 --- a/tests/typ/example-coma.typ +++ b/tests/typ/example-coma.typ @@ -1,6 +1,6 @@ // Test integration of syntax, page setup, box layout and alignment. -[page: width=450pt, height=300pt, margins=1cm] +[page width: 450pt, height: 300pt, margins: 1cm] [box][ *Technische Universität Berlin* \ @@ -9,17 +9,17 @@ Dr. Max Mustermann \ Ola Nordmann, John Doe ] -[align: right >> box][*WiSe 2019/2020* \ Woche 3] +[align right | box][*WiSe 2019/2020* \ Woche 3] -[v: 6mm] +[v 6mm] -[align: center][ - #### 3. Übungsblatt Computerorientierte Mathematik II [v: 2mm] - *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) [v: 2mm] +[align center][ + #### 3. Übungsblatt Computerorientierte Mathematik II [v 2mm] + *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) [v 2mm] *Alle Antworten sind zu beweisen.* ] -*1. Aufgabe* [align: right][(1 + 1 + 2 Punkte)] +*1. Aufgabe* [align right][(1 + 1 + 2 Punkte)] Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat. Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel diff --git a/tests/typ/func-font-error.typ b/tests/typ/func-font-error.typ index 8de754ae..492ef9df 100644 --- a/tests/typ/func-font-error.typ +++ b/tests/typ/func-font-error.typ @@ -1,17 +1,17 @@ // Test error cases of the `font` function. // Not one of the valid things for positional arguments. -[font: false] +[font false] // Wrong types. -[font: style=bold, weight="thin", emoji=0] +[font style: bold, weight: "thin", serif: 0] // Non-existing argument. -[font: something="invalid"] +[font something: "invalid"] // compare-ref: false -// error: 4:8-4:13 unexpected argument +// error: 4:7-4:12 unexpected argument // error: 7:14-7:18 invalid font style -// error: 7:27-7:33 expected font weight, found string -// error: 7:41-7:42 expected family or list of families, found integer -// error: 10:8-10:27 unexpected argument +// error: 7:28-7:34 expected font weight, found string +// error: 7:43-7:44 expected family or list of families, found integer +// error: 10:7-10:27 unexpected argument diff --git a/tests/typ/func-font-fallback.typ b/tests/typ/func-font-fallback.typ index b6509e62..9b60d46c 100644 --- a/tests/typ/func-font-fallback.typ +++ b/tests/typ/func-font-fallback.typ @@ -4,15 +4,15 @@ Emoji: 🏀 // CMU Serif + Noto Emoji. -[font: "CMU Serif", "Noto Emoji"][Emoji: 🏀] +[font "CMU Serif", "Noto Emoji"][Emoji: 🏀] // Class definitions. -[font: math=("CMU Serif", "Latin Modern Math", "Noto Emoji")] -[font: math][Math: ∫ α + β ➗ 3] +[font math: ("CMU Serif", "Latin Modern Math", "Noto Emoji")] +[font math][Math: ∫ α + β ➗ 3] // Class redefinition. -[font: sans-serif="Noto Emoji"] -[font: sans-serif=("Archivo", sans-serif)] +[font sans-serif: "Noto Emoji"] +[font sans-serif: ("Archivo", sans-serif)] New sans-serif. 🚀 // TODO: Add tests for other scripts. diff --git a/tests/typ/func-font-properties.typ b/tests/typ/func-font-properties.typ index 78093e98..af8b8891 100644 --- a/tests/typ/func-font-properties.typ +++ b/tests/typ/func-font-properties.typ @@ -1,20 +1,20 @@ // Test configuring font properties. -[font: "PT Sans", 10pt] +[font "PT Sans", 10pt] // Set same font size in three different ways. -[font: 20pt][A] -[font: 200%][A] -[font: 15pt + 50%][A] +[font 20pt][A] +[font 200%][A] +[font 15pt + 50%][A] // Do nothing. [font][Normal] // Set style (is available). -[font: style=italic][Italic] +[font style: italic][Italic] // Set weight (is available). -[font: weight=bold][Bold] +[font weight: bold][Bold] // Set stretch (not available, matching closest). -[font: stretch=ultra-condensed][Condensed] +[font stretch: ultra-condensed][Condensed] diff --git a/tests/typ/func-h-and-v.typ b/tests/typ/func-h-and-v.typ index 9c6d5730..0587b3ed 100644 --- a/tests/typ/func-h-and-v.typ +++ b/tests/typ/func-h-and-v.typ @@ -1,25 +1,25 @@ // Test the `h` and `v` functions. // Ends paragraphs. -Tightly [v: -5pt] packed +Tightly [v -5pt] packed // Eating up soft spacing. -Inv [h: 0pt] isible +Inv [h 0pt] isible // Multiple spacings in a row. -Add [h: 10pt] [h: 10pt] up +Add [h 10pt] [h 10pt] up // Relative to font size. -Relative [h: 100%] spacing +Relative [h 100%] spacing // Missing spacing. Totally [h] ignored // Swapped axes. -[page: main-dir=rtl, cross-dir=ttb][ - 1 [h: 1cm] 2 +[page main-dir: rtl, cross-dir: ttb][ + 1 [h 1cm] 2 - 3 [v: 1cm] 4 [v: -1cm] 5 + 3 [v 1cm] 4 [v -1cm] 5 ] // error: 16:11-16:11 missing argument: spacing diff --git a/tests/typ/func-image-error.typ b/tests/typ/func-image-error.typ index e6a989ca..15553420 100644 --- a/tests/typ/func-image-error.typ +++ b/tests/typ/func-image-error.typ @@ -1,11 +1,11 @@ // Test error cases of the `image` function. // File does not exist. -[image: "path/does/not/exist"] +[image "path/does/not/exist"] // File exists, but is no image. -[image: "typ/image-error.typ"] +[image "typ/image-error.typ"] // compare-ref: false -// error: 4:9-4:30 failed to load image -// error: 7:9-7:30 failed to load image +// error: 4:8-4:29 failed to load image +// error: 7:8-7:29 failed to load image diff --git a/tests/typ/func-image-fit.typ b/tests/typ/func-image-fit.typ index eca7c1e4..a9855aa4 100644 --- a/tests/typ/func-image-fit.typ +++ b/tests/typ/func-image-fit.typ @@ -1,23 +1,23 @@ // Test configuring the size and fitting behaviour of images. // Fit to width of page. -[image: "res/rhino.png"] +[image "res/rhino.png"] // Fit to height of page. -[page: width=270pt][ - [image: "res/rhino.png"] +[page width: 270pt][ + [image "res/rhino.png"] ] // Set width explicitly. -[image: "res/rhino.png", width=50pt] +[image "res/rhino.png", width: 50pt] // Set height explicitly. -[image: "res/rhino.png", height=50pt] +[image "res/rhino.png", height: 50pt] // Set width and height explicitly and force stretching. -[image: "res/rhino.png", width=25pt, height=50pt] +[image "res/rhino.png", width: 25pt, height: 50pt] // Make sure the bounding-box of the image is correct. -[align: bottom, right][ - [image: "res/tiger.jpg"] +[align bottom, right][ + [image "res/tiger.jpg"] ] diff --git a/tests/typ/func-image-formats.typ b/tests/typ/func-image-formats.typ index 36b991d0..c12e3639 100644 --- a/tests/typ/func-image-formats.typ +++ b/tests/typ/func-image-formats.typ @@ -1,8 +1,8 @@ // Test loading different image formats. // Load an RGBA PNG image. -[image: "res/rhino.png"] +[image "res/rhino.png"] [pagebreak] // Load an RGB JPEG image. -[image: "res/tiger.jpg"] +[image "res/tiger.jpg"] diff --git a/tests/typ/func-page-body.typ b/tests/typ/func-page-body.typ index 78e72d12..bfa9775d 100644 --- a/tests/typ/func-page-body.typ +++ b/tests/typ/func-page-body.typ @@ -1,6 +1,6 @@ // Test a combination of pages with bodies and normal content. -[page: height=50pt] +[page height: 50pt] [page][First] [page][Second] diff --git a/tests/typ/func-page-dirs.typ b/tests/typ/func-page-dirs.typ index 09ba4e9e..47e8ae15 100644 --- a/tests/typ/func-page-dirs.typ +++ b/tests/typ/func-page-dirs.typ @@ -1,5 +1,5 @@ // Test changing the layouting directions of pages. -[page: main-dir=btt, cross-dir=rtl] +[page main-dir: btt, cross-dir: rtl] Right to left! diff --git a/tests/typ/func-page-error.typ b/tests/typ/func-page-error.typ index e259a04e..1b2db60d 100644 --- a/tests/typ/func-page-error.typ +++ b/tests/typ/func-page-error.typ @@ -1,11 +1,11 @@ // Test error cases of the `page` function. // Invalid paper. -[page: nonexistant] +[page nonexistant] // Aligned axes. -[page: main-dir=ltr] +[page main-dir: ltr] // compare-ref: false -// error: 4:8-4:19 invalid paper +// error: 4:7-4:18 invalid paper // error: 7:17-7:20 aligned axis diff --git a/tests/typ/func-page-metrics.typ b/tests/typ/func-page-metrics.typ index 6c7bd461..7e0bc2f8 100644 --- a/tests/typ/func-page-metrics.typ +++ b/tests/typ/func-page-metrics.typ @@ -1,25 +1,25 @@ // Test configuring page sizes and margins. // Set width. -[page: width=50pt][High] +[page width: 50pt][High] // Set height. -[page: height=50pt][Wide] +[page height: 50pt][Wide] // Set all margins at once. -[page: margins=40pt][ - [align: top, left][TL] - [align: bottom, right][BR] +[page margins: 40pt][ + [align top, left][TL] + [align bottom, right][BR] ] // Set individual margins. -[page: left=0pt >> align: left][Left] -[page: right=0pt >> align: right][Right] -[page: top=0pt >> align: top][Top] -[page: bottom=0pt >> align: bottom][Bottom] +[page left: 0pt | align left][Left] +[page right: 0pt | align right][Right] +[page top: 0pt | align top][Top] +[page bottom: 0pt | align bottom][Bottom] // Ensure that specific margins override general margins. -[page: margins=0pt, left=40pt][Overriden] +[page margins: 0pt, left: 40pt][Overriden] // Flip the page. -[page: a10, flip=true][Flipped] +[page a10, flip: true][Flipped] diff --git a/tests/typ/func-pagebreak.typ b/tests/typ/func-pagebreak.typ index 7fd9aae2..603e11d4 100644 --- a/tests/typ/func-pagebreak.typ +++ b/tests/typ/func-pagebreak.typ @@ -2,4 +2,4 @@ First of two [pagebreak] -[page: height=40pt] +[page height: 40pt] diff --git a/tests/typ/func-rgb.typ b/tests/typ/func-rgb.typ index 44d87819..b47039a2 100644 --- a/tests/typ/func-rgb.typ +++ b/tests/typ/func-rgb.typ @@ -1,24 +1,24 @@ // Test the `rgb` function. // Check the output. -[rgb: 0.0, 0.3, 0.7] [val: #004db3] +[rgb 0.0, 0.3, 0.7] [val #004db3] // Alpha channel. -[rgb: 1.0, 0.0, 0.0, 0.5] +[rgb 1.0, 0.0, 0.0, 0.5] // Value smaller than 0.0 and larger than 1.0 -[rgb: -30, 15.5, 0.5] +[rgb -30, 15.5, 0.5] // Missing blue component. -[rgb: 0, 1] +[rgb 0, 1] // Missing all components. [rgb] -// error: 4:23-4:26 unknown function -// error: 10:7-10:10 should be between 0.0 and 1.0 -// error: 10:12-10:16 should be between 0.0 and 1.0 -// error: 13:7-13:11 missing argument: blue component +// error: 4:22-4:25 unknown function +// error: 10:6-10:9 should be between 0.0 and 1.0 +// error: 10:11-10:15 should be between 0.0 and 1.0 +// error: 13:6-13:10 missing argument: blue component // error: 16:5-16:5 missing argument: red component // error: 16:5-16:5 missing argument: green component // error: 16:5-16:5 missing argument: blue component |
