summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-05-02 18:25:53 +0200
committerMartin Haug <mhaug@live.de>2022-05-02 18:25:53 +0200
commit9b4397cdab25daff448cefb179a4699f64fa3d3f (patch)
treed5a684a4bcc0846e3213f3777f33159db21a2639 /tests
parentf07395f9a47502c50f767f78a233d0e2a6e4445f (diff)
Tests for the new shape API
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/graphics/shape-ellipse.pngbin22046 -> 24571 bytes
-rw-r--r--tests/ref/graphics/shape-fill-stroke.pngbin2997 -> 6371 bytes
-rw-r--r--tests/ref/graphics/shape-rect.pngbin7261 -> 13791 bytes
-rw-r--r--tests/typ/graphics/shape-ellipse.typ3
-rw-r--r--tests/typ/graphics/shape-fill-stroke.typ10
-rw-r--r--tests/typ/graphics/shape-rect.typ27
6 files changed, 40 insertions, 0 deletions
diff --git a/tests/ref/graphics/shape-ellipse.png b/tests/ref/graphics/shape-ellipse.png
index 740f005f..296fc14e 100644
--- a/tests/ref/graphics/shape-ellipse.png
+++ b/tests/ref/graphics/shape-ellipse.png
Binary files differ
diff --git a/tests/ref/graphics/shape-fill-stroke.png b/tests/ref/graphics/shape-fill-stroke.png
index f2278c88..91cddcc2 100644
--- a/tests/ref/graphics/shape-fill-stroke.png
+++ b/tests/ref/graphics/shape-fill-stroke.png
Binary files differ
diff --git a/tests/ref/graphics/shape-rect.png b/tests/ref/graphics/shape-rect.png
index 1fdb0dac..5bbaf3db 100644
--- a/tests/ref/graphics/shape-rect.png
+++ b/tests/ref/graphics/shape-rect.png
Binary files differ
diff --git a/tests/typ/graphics/shape-ellipse.typ b/tests/typ/graphics/shape-ellipse.typ
index 547acd38..ba4d0d0a 100644
--- a/tests/typ/graphics/shape-ellipse.typ
+++ b/tests/typ/graphics/shape-ellipse.typ
@@ -21,3 +21,6 @@ Auto-sized ellipse. \
#set text(8pt)
But, soft! what light through yonder window breaks?
]
+
+
+An inline #ellipse(width: 8pt, height: 6pt, outset: (top: 3pt, rest: 5.5pt)) ellipse. \ No newline at end of file
diff --git a/tests/typ/graphics/shape-fill-stroke.typ b/tests/typ/graphics/shape-fill-stroke.typ
index c09cb065..d14d0981 100644
--- a/tests/typ/graphics/shape-fill-stroke.typ
+++ b/tests/typ/graphics/shape-fill-stroke.typ
@@ -38,3 +38,13 @@
#sq(stroke: blue)
#sq(fill: teal, stroke: blue)
#sq(fill: teal, stroke: 2pt + blue)
+
+---
+// Test stroke composition.
+#set square(stroke: 4pt)
+#set text("Roboto")
+#square(
+ stroke: (left: red, top: yellow, right: green, bottom: blue),
+ radius: 100%, align(center+horizon)[*G*],
+ inset: 8pt
+)
diff --git a/tests/typ/graphics/shape-rect.typ b/tests/typ/graphics/shape-rect.typ
index 52fe03ea..3d157675 100644
--- a/tests/typ/graphics/shape-rect.typ
+++ b/tests/typ/graphics/shape-rect.typ
@@ -27,3 +27,30 @@
\{#rect(width: 0.5in, height: 7pt, fill: rgb("d6cd67"))
#rect(width: 0.5in, height: 7pt, fill: rgb("edd466"))
#rect(width: 0.5in, height: 7pt, fill: rgb("e3be62"))\}
+
+// Rounded corners.
+#rect(width: 2cm, radius: 60%)
+#rect(width: 1cm, radius: (x: 5pt, y: 10pt))
+#rect(width: 1.25cm, radius: (left: 2pt, top: 5pt, right: 8pt, bottom: 11pt))
+
+// Different strokes.
+[
+ #set rect(stroke: (right: red,))
+ #rect(width: 100%, fill: lime, stroke: (x: 5pt, y: 1pt))
+]
+
+---
+// Outset padding.
+#let inline-code(body) = [
+ #set text("IBM Plex Mono", 8pt)
+ #h(.7em, weak: true)
+ #rect(radius: 3pt, outset: (y: 3pt, x: 2.5pt), fill: rgb(239, 241, 243), body)
+ #h(.7em, weak: true)
+]
+
+Use the #inline-code[\*const ptr] pointer.
+
+---
+// Error: 15-38 unexpected key "cake"
+#rect(radius: (left: 10pt, cake: 5pt))
+