summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/code/repr.pngbin28698 -> 32209 bytes
-rw-r--r--tests/ref/graphics/shape-fill-stroke.pngbin2893 -> 2997 bytes
-rw-r--r--tests/ref/structure/table.pngbin1566 -> 4295 bytes
-rw-r--r--tests/ref/text/deco.pngbin29421 -> 31937 bytes
-rw-r--r--tests/typ/code/repr.typ34
-rw-r--r--tests/typ/graphics/line.typ2
-rw-r--r--tests/typ/graphics/shape-circle.typ2
-rw-r--r--tests/typ/graphics/shape-ellipse.typ2
-rw-r--r--tests/typ/graphics/shape-fill-stroke.typ24
-rw-r--r--tests/typ/graphics/shape-rect.typ3
-rw-r--r--tests/typ/structure/table.typ9
-rw-r--r--tests/typ/text/deco.typ12
12 files changed, 50 insertions, 38 deletions
diff --git a/tests/ref/code/repr.png b/tests/ref/code/repr.png
index 822b096d..4474149a 100644
--- a/tests/ref/code/repr.png
+++ b/tests/ref/code/repr.png
Binary files differ
diff --git a/tests/ref/graphics/shape-fill-stroke.png b/tests/ref/graphics/shape-fill-stroke.png
index 12fcbd55..f2278c88 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/structure/table.png b/tests/ref/structure/table.png
index bc70d548..f50f613b 100644
--- a/tests/ref/structure/table.png
+++ b/tests/ref/structure/table.png
Binary files differ
diff --git a/tests/ref/text/deco.png b/tests/ref/text/deco.png
index 684532a1..94bd8a38 100644
--- a/tests/ref/text/deco.png
+++ b/tests/ref/text/deco.png
Binary files differ
diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ
index f766ee7e..8742f413 100644
--- a/tests/typ/code/repr.typ
+++ b/tests/typ/code/repr.typ
@@ -1,17 +1,8 @@
// Test representation of values in the document.
---
-// Variables.
-#let name = "Typst"
-#let ke-bab = "Kebab!"
-#let α = "Alpha"
-
-{name} \
-{ke-bab} \
-{α}
-
----
// Literal values.
+{auto} \
{none} (empty) \
{true} \
{false}
@@ -27,29 +18,30 @@
{4.5cm} \
{12e1pt} \
{2.5rad} \
-{45deg}
+{45deg} \
+{1.7em} \
+{1cm + 0em} \
+{2em + 10pt} \
+{2.3fr}
---
// Colors.
-#rgb("f7a20500")
+#rgb("f7a20500") \
+{2pt + rgb("f7a20500")}
---
// Strings and escaping.
-{"hi"} \
-{"a\n[]\"\u{1F680}string"}
+#repr("hi") \
+#repr("a\n[]\"\u{1F680}string")
---
// Content.
-{[*{"H" + "i"} there*]}
+#repr[*{"H" + "i"} there*]
---
// Functions
#let f(x) = x
-{rect} \
+{() => none} \
{f} \
-{() => none}
-
----
-// When using the `repr` function it's not in monospace.
-#repr(23deg)
+{rect}
diff --git a/tests/typ/graphics/line.typ b/tests/typ/graphics/line.typ
index 050ce05c..97dcb5cf 100644
--- a/tests/typ/graphics/line.typ
+++ b/tests/typ/graphics/line.typ
@@ -37,7 +37,7 @@
]
]
-#align(center, grid(columns: (1fr,) * 3, ..((star(20pt, thickness: .5pt),) * 9)))
+#align(center, grid(columns: (1fr,) * 3, ..((star(20pt, stroke: 0.5pt),) * 9)))
---
// Test errors.
diff --git a/tests/typ/graphics/shape-circle.typ b/tests/typ/graphics/shape-circle.typ
index 4b978e86..dc1e3f24 100644
--- a/tests/typ/graphics/shape-circle.typ
+++ b/tests/typ/graphics/shape-circle.typ
@@ -9,7 +9,7 @@
// Test auto sizing.
Auto-sized circle. \
-#circle(fill: rgb("eb5278"), stroke: black, thickness: 2pt,
+#circle(fill: rgb("eb5278"), stroke: 2pt + black,
align(center + horizon)[But, soft!]
)
diff --git a/tests/typ/graphics/shape-ellipse.typ b/tests/typ/graphics/shape-ellipse.typ
index 154144c4..995eabb9 100644
--- a/tests/typ/graphics/shape-ellipse.typ
+++ b/tests/typ/graphics/shape-ellipse.typ
@@ -17,7 +17,7 @@ Rect in ellipse in fixed rect. \
)
Auto-sized ellipse. \
-#ellipse(fill: conifer, stroke: forest, thickness: 3pt, padding: 3pt)[
+#ellipse(fill: conifer, stroke: 3pt + forest, padding: 3pt)[
#set text(8pt)
But, soft! what light through yonder window breaks?
]
diff --git a/tests/typ/graphics/shape-fill-stroke.typ b/tests/typ/graphics/shape-fill-stroke.typ
index dd5b9ee8..c09cb065 100644
--- a/tests/typ/graphics/shape-fill-stroke.typ
+++ b/tests/typ/graphics/shape-fill-stroke.typ
@@ -6,15 +6,15 @@
variant(stroke: none),
variant(),
variant(fill: none),
- variant(thickness: 2pt),
+ variant(stroke: 2pt),
variant(stroke: eastern),
- variant(stroke: eastern, thickness: 2pt),
+ variant(stroke: eastern + 2pt),
variant(fill: eastern),
variant(fill: eastern, stroke: none),
- variant(fill: forest, stroke: none, thickness: 2pt),
+ variant(fill: forest, stroke: none),
variant(fill: forest, stroke: conifer),
- variant(fill: forest, stroke: black, thickness: 2pt),
- variant(fill: forest, stroke: conifer, thickness: 2pt),
+ variant(fill: forest, stroke: black + 2pt),
+ variant(fill: forest, stroke: conifer + 2pt),
) {
(align(horizon)[{i + 1}.], item, [])
}
@@ -24,3 +24,17 @@
gutter: 5pt,
..items,
)
+
+---
+// Test stroke folding.
+#let sq = square.with(size: 10pt)
+
+#set square(stroke: none)
+#sq()
+#set square(stroke: auto)
+#sq()
+#sq(fill: teal)
+#sq(stroke: 2pt)
+#sq(stroke: blue)
+#sq(fill: teal, stroke: blue)
+#sq(fill: teal, stroke: 2pt + blue)
diff --git a/tests/typ/graphics/shape-rect.typ b/tests/typ/graphics/shape-rect.typ
index add39b80..e035fc91 100644
--- a/tests/typ/graphics/shape-rect.typ
+++ b/tests/typ/graphics/shape-rect.typ
@@ -14,8 +14,7 @@
#block(rect(
height: 15pt,
fill: rgb("46b3c2"),
- stroke: rgb("234994"),
- thickness: 2pt,
+ stroke: 2pt + rgb("234994"),
))
// Fixed width, text height.
diff --git a/tests/typ/structure/table.typ b/tests/typ/structure/table.typ
index 0372951c..57b71ede 100644
--- a/tests/typ/structure/table.typ
+++ b/tests/typ/structure/table.typ
@@ -1,13 +1,18 @@
+// Test tables.
+
+---
#set page(height: 70pt)
#set table(primary: rgb("aaa"), secondary: none)
#table(
columns: (1fr,) * 3,
- stroke: rgb("333"),
- thickness: 2pt,
+ stroke: 2pt + rgb("333"),
[A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H],
)
---
+#table(columns: 3, stroke: none, fill: green, [A], [B], [C])
+
+---
// Ref: false
#table()
diff --git a/tests/typ/text/deco.typ b/tests/typ/text/deco.typ
index 071208ac..5e9de5b3 100644
--- a/tests/typ/text/deco.typ
+++ b/tests/typ/text/deco.typ
@@ -20,12 +20,14 @@
---
#let redact = strike.with(10pt, extent: 0.05em)
-#let highlight = strike.with(
- stroke: rgb("abcdef88"),
- thickness: 10pt,
- extent: 0.05em,
-)
+#let highlight = strike.with(stroke: 10pt + rgb("abcdef88"), extent: 0.05em)
// Abuse thickness and transparency for redacting and highlighting stuff.
Sometimes, we work #redact[in secret].
There might be #highlight[redacted] things.
+ underline()
+
+---
+// Test stroke folding.
+#set underline(stroke: 2pt, offset: 2pt)
+#underline(text(red, [DANGER!]))