diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-04-26 13:46:42 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-04-26 15:37:21 +0200 |
| commit | 3680c854a21db665d64cdb8f31aa0f9a1af16ceb (patch) | |
| tree | 39dfa33059293251f1e2890f9b3d0e3dc178ed03 /tests | |
| parent | 59957746e91c1322a8ca6d228bcaa0f31941ee1b (diff) | |
Touch up docs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/bugs/args-underscore.typ | 5 | ||||
| -rw-r--r-- | tests/typ/compiler/show-node.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/show-selector.typ | 4 | ||||
| -rw-r--r-- | tests/typ/compute/data.typ | 4 | ||||
| -rw-r--r-- | tests/typ/math/matrix.typ | 8 | ||||
| -rw-r--r-- | tests/typ/meta/query-before-after.typ | 24 | ||||
| -rw-r--r-- | tests/typ/visualize/stroke.typ | 78 |
7 files changed, 65 insertions, 60 deletions
diff --git a/tests/typ/bugs/args-underscore.typ b/tests/typ/bugs/args-underscore.typ new file mode 100644 index 00000000..ca3c0ff8 --- /dev/null +++ b/tests/typ/bugs/args-underscore.typ @@ -0,0 +1,5 @@ +// Test that lone underscore works. +// Ref: false + +--- +#test((1, 2, 3).map(_ => {}).len(), 3) diff --git a/tests/typ/compiler/show-node.typ b/tests/typ/compiler/show-node.typ index 42aee506..99a4364e 100644 --- a/tests/typ/compiler/show-node.typ +++ b/tests/typ/compiler/show-node.typ @@ -96,7 +96,7 @@ Hey = Heading --- -// Error: 7-10 expected function, label, string, regular expression, location, or selector, found color +// Error: 7-10 expected function, label, string, regular expression, or selector, found color #show red: [] --- diff --git a/tests/typ/compiler/show-selector.typ b/tests/typ/compiler/show-selector.typ index d1229eee..19f43fee 100644 --- a/tests/typ/compiler/show-selector.typ +++ b/tests/typ/compiler/show-selector.typ @@ -37,3 +37,7 @@ the ```rs &mut T``` reference. = Red == Blue === Green + +--- +// Error: 7-35 this selector cannot be used with show +#show selector(heading).or(strong): none diff --git a/tests/typ/compute/data.typ b/tests/typ/compute/data.typ index 8b50f7c4..96b655c0 100644 --- a/tests/typ/compute/data.typ +++ b/tests/typ/compute/data.typ @@ -43,7 +43,7 @@ --- // Test reading TOML data. -#let data = toml("/toml_types.toml") +#let data = toml("/toml-types.toml") #test(data.string, "wonderful") #test(data.integer, 42) #test(data.float, 3.14) @@ -60,7 +60,7 @@ --- // Test reading YAML data -#let data = yaml("/yamltypes.yaml") +#let data = yaml("/yaml-types.yaml") #test(data.len(), 7) #test(data.null_key, (none, none)) #test(data.string, "text") diff --git a/tests/typ/math/matrix.typ b/tests/typ/math/matrix.typ index c1fba627..514827c3 100644 --- a/tests/typ/math/matrix.typ +++ b/tests/typ/math/matrix.typ @@ -23,10 +23,10 @@ $ mat( --- // Test baseline alignment. $ mat( - a, b^2; - sum_(x \ y) x, a^(1/2); - zeta, alpha; - ) $ + a, b^2; + sum_(x \ y) x, a^(1/2); + zeta, alpha; +) $ --- // Test alternative delimiter with set rule. diff --git a/tests/typ/meta/query-before-after.typ b/tests/typ/meta/query-before-after.typ index 734e84b4..7488a2d5 100644 --- a/tests/typ/meta/query-before-after.typ +++ b/tests/typ/meta/query-before-after.typ @@ -11,18 +11,18 @@ #set text(size: 12pt, weight: "regular") #outline( - title: "Chapter outline", - indent: true, - target: heading - .where(level: 1) - .or(heading.where(level: 2)) - .after(it.location(), inclusive: true) - .before( - heading - .where(level: 1, outlined: true) - .after(it.location(), inclusive: false), - inclusive: false, - ) + title: "Chapter outline", + indent: true, + target: heading + .where(level: 1) + .or(heading.where(level: 2)) + .after(it.location(), inclusive: true) + .before( + heading + .where(level: 1, outlined: true) + .after(it.location(), inclusive: false), + inclusive: false, + ) ) ] diff --git a/tests/typ/visualize/stroke.typ b/tests/typ/visualize/stroke.typ index 60733d78..844cd8c2 100644 --- a/tests/typ/visualize/stroke.typ +++ b/tests/typ/visualize/stroke.typ @@ -2,22 +2,19 @@ --- // Some simple test lines - #line(length: 60pt, stroke: red) #v(3pt) #line(length: 60pt, stroke: 2pt) #v(3pt) #line(length: 60pt, stroke: blue + 1.5pt) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: "dashed")) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: "dashed")) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 4pt, cap: "round")) +#line(length: 60pt, stroke: (paint: red, thickness: 4pt, cap: "round")) --- // Set rules with stroke - -#set line(stroke: (color: red, thickness: 1pt, cap: "butt", dash: "dashdotted")) - +#set line(stroke: (paint: red, thickness: 1pt, cap: "butt", dash: "dash-dotted")) #line(length: 60pt) #v(3pt) #line(length: 60pt, stroke: blue) @@ -26,79 +23,78 @@ --- // Rectangle strokes - #rect(width: 20pt, height: 20pt, stroke: red) #v(3pt) -#rect(width: 20pt, height: 20pt, stroke: (rest: red, top: (color: blue, dash: "dashed"))) +#rect(width: 20pt, height: 20pt, stroke: (rest: red, top: (paint: blue, dash: "dashed"))) #v(3pt) #rect(width: 20pt, height: 20pt, stroke: (thickness: 5pt, join: "round")) --- // Dashing -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: ("dot", 1pt))) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: ("dot", 1pt))) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: ("dot", 1pt, 4pt, 2pt))) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: ("dot", 1pt, 4pt, 2pt))) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: (array: ("dot", 1pt, 4pt, 2pt), phase: 5pt))) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: (array: ("dot", 1pt, 4pt, 2pt), phase: 5pt))) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: ())) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: ())) #v(3pt) -#line(length: 60pt, stroke: (color: red, thickness: 1pt, dash: (1pt, 3pt, 9pt))) +#line(length: 60pt, stroke: (paint: red, thickness: 1pt, dash: (1pt, 3pt, 9pt))) --- // Line joins -#stack(dir: ltr, - polygon(stroke: (thickness: 4pt, color: blue, join: "round"), +#stack( + dir: ltr, + spacing: 1em, + polygon(stroke: (thickness: 4pt, paint: blue, join: "round"), (0pt, 20pt), (15pt, 0pt), (0pt, 40pt), (15pt, 45pt)), - h(1em), - polygon(stroke: (thickness: 4pt, color: blue, join: "bevel"), + polygon(stroke: (thickness: 4pt, paint: blue, join: "bevel"), (0pt, 20pt), (15pt, 0pt), (0pt, 40pt), (15pt, 45pt)), - h(1em), - polygon(stroke: (thickness: 4pt, color: blue, join: "miter"), + polygon(stroke: (thickness: 4pt, paint: blue, join: "miter"), (0pt, 20pt), (15pt, 0pt), (0pt, 40pt), (15pt, 45pt)), - h(1em), - polygon(stroke: (thickness: 4pt, color: blue, join: "miter", miter-limit: 20.0), + polygon(stroke: (thickness: 4pt, paint: blue, join: "miter", miter-limit: 20.0), (0pt, 20pt), (15pt, 0pt), (0pt, 40pt), (15pt, 45pt)), ) --- -// Error: 29-56 unexpected key "thicknes", valid keys are "color", "thickness", "cap", "join", "dash", and "miter-limit" -#line(length: 60pt, stroke: (color: red, thicknes: 1pt)) +// Error: 29-56 unexpected key "thicknes", valid keys are "paint", "thickness", "cap", "join", "dash", and "miter-limit" +#line(length: 60pt, stroke: (paint: red, thicknes: 1pt)) --- -// Error: 29-55 expected "solid", "dotted", "densely-dotted", "loosely-dotted", "dashed", "densely-dashed", "loosely-dashed", "dashdotted", "densely-dashdotted", "loosely-dashdotted", array, dictionary, dash pattern, or none -#line(length: 60pt, stroke: (color: red, dash: "dash")) +// Error: 29-55 expected "solid", "dotted", "densely-dotted", "loosely-dotted", "dashed", "densely-dashed", "loosely-dashed", "dash-dotted", "densely-dash-dotted", "loosely-dash-dotted", array, dictionary, dash pattern, or none +#line(length: 60pt, stroke: (paint: red, dash: "dash")) --- // 0pt strokes must function exactly like 'none' strokes and not draw anything + #rect(width: 10pt, height: 10pt, stroke: none) #rect(width: 10pt, height: 10pt, stroke: 0pt) - #rect(width: 10pt, height: 10pt, stroke: none, fill: blue) #rect(width: 10pt, height: 10pt, stroke: 0pt + red, fill: blue) #line(length: 30pt, stroke: 0pt) -#line(length: 30pt, stroke: (color: red, thickness: 0pt, dash: ("dot", 1pt))) +#line(length: 30pt, stroke: (paint: red, thickness: 0pt, dash: ("dot", 1pt))) #table(columns: 2, stroke: none)[A][B] #table(columns: 2, stroke: 0pt)[A][B] #path( - fill: red, - stroke: none, - closed: true, - ((0%, 0%), (4%, -4%)), - ((50%, 50%), (4%, -4%)), - ((0%, 50%), (4%, 4%)), - ((50%, 0%), (4%, 4%)), + fill: red, + stroke: none, + closed: true, + ((0%, 0%), (4%, -4%)), + ((50%, 50%), (4%, -4%)), + ((0%, 50%), (4%, 4%)), + ((50%, 0%), (4%, 4%)), ) + #path( - fill: red, - stroke: 0pt, - closed: true, - ((0%, 0%), (4%, -4%)), - ((50%, 50%), (4%, -4%)), - ((0%, 50%), (4%, 4%)), - ((50%, 0%), (4%, 4%)), + fill: red, + stroke: 0pt, + closed: true, + ((0%, 0%), (4%, -4%)), + ((50%, 50%), (4%, -4%)), + ((0%, 50%), (4%, 4%)), + ((50%, 0%), (4%, 4%)), ) |
