summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/repr.pngbin10208 -> 10195 bytes
-rw-r--r--tests/typ/control/let.typ4
-rw-r--r--tests/typ/expand.typ6
-rw-r--r--tests/typ/expr/ops-invalid.typ10
-rw-r--r--tests/typ/full/coma.typ6
-rw-r--r--tests/typ/library/base.typ2
-rw-r--r--tests/typ/library/pad.typ8
-rw-r--r--tests/typ/library/shapes.typ26
-rw-r--r--tests/typ/markup/emph.typ2
-rw-r--r--tests/typ/markup/heading.typ4
-rw-r--r--tests/typ/markup/strong.typ2
-rw-r--r--tests/typ/repr.typ2
12 files changed, 37 insertions, 35 deletions
diff --git a/tests/ref/repr.png b/tests/ref/repr.png
index 21d7af27..2f5697fd 100644
--- a/tests/ref/repr.png
+++ b/tests/ref/repr.png
Binary files differ
diff --git a/tests/typ/control/let.typ b/tests/typ/control/let.typ
index 7752ec90..dd971ee5 100644
--- a/tests/typ/control/let.typ
+++ b/tests/typ/control/let.typ
@@ -18,8 +18,8 @@
---
// Syntax sugar for function definitions.
#let background = #239dad
-#let box(body) = box(width: 2cm, height: 1cm, color: background, body)
-#box[Hi!]
+#let rect(body) = rect(width: 2cm, height: 1cm, fill: background, body)
+#rect[Hi!]
// Error: 13 expected body
#let func(x)
diff --git a/tests/typ/expand.typ b/tests/typ/expand.typ
index 3b242928..23044744 100644
--- a/tests/typ/expand.typ
+++ b/tests/typ/expand.typ
@@ -6,9 +6,9 @@
// Top-level paragraph fills page, boxed paragraph only when width is fixed.
L #right[R] \
-#box(width: 50pt)[L #right[R]] \
-#box[L #right[R]] \
+#rect(width: 50pt)[L #right[R]] \
+#rect[L #right[R]] \
// Pad inherits expansion behaviour.
#pad[PL #right[PR]] \
-#box(pad[PL #right[PR]])
+#rect(pad[PL #right[PR]])
diff --git a/tests/typ/expr/ops-invalid.typ b/tests/typ/expr/ops-invalid.typ
index f760ae31..12d2a2c3 100644
--- a/tests/typ/expr/ops-invalid.typ
+++ b/tests/typ/expr/ops-invalid.typ
@@ -50,10 +50,10 @@
// Error: 3-4 unknown variable
{ z = 1 }
-// Error: 3-6 cannot assign to a constant
-{ box = "hi" }
+// Error: 3-7 cannot assign to a constant
+{ rect = "hi" }
-// Works if we define box beforehand
+// Works if we define rect beforehand
// (since then it doesn't resolve to the standard library version anymore).
-#let box = ""
-{ box = "hi" }
+#let rect = ""
+{ rect = "hi" }
diff --git a/tests/typ/full/coma.typ b/tests/typ/full/coma.typ
index d324627f..243c667f 100644
--- a/tests/typ/full/coma.typ
+++ b/tests/typ/full/coma.typ
@@ -10,10 +10,10 @@
#let university = [*Technische Universität {city}*]
#let faculty = [*Fakultät II, Institut for Mathematik*]
-// The `box` function just places content into a rectangular container. When
+// The `rect` function just places content into a rectangular container. When
// the only argument to a function is a template, the parentheses can be omitted
// (i.e. `f[a]` is the same as `f([a])`).
-#box[
+#rect[
// Backslash adds a forced line break.
#university \
#faculty \
@@ -21,7 +21,7 @@
Dr. Max Mustermann \
Ola Nordmann, John Doe
]
-#align(right, box[*WiSe 2019/2020* \ Woche 3])
+#align(right, rect[*WiSe 2019/2020* \ Woche 3])
// Adds vertical spacing.
#v(6mm)
diff --git a/tests/typ/library/base.typ b/tests/typ/library/base.typ
index 000a80ea..29c976c2 100644
--- a/tests/typ/library/base.typ
+++ b/tests/typ/library/base.typ
@@ -3,7 +3,7 @@
---
#test(type("hi"), "string")
-#test(repr([Hi #box[there]]), "[Hi [<node box>]]")
+#test(repr([Hi #rect[there]]), "[Hi [<node box>]]")
---
// Check the output.
diff --git a/tests/typ/library/pad.typ b/tests/typ/library/pad.typ
index c8bfe907..c3d3786b 100644
--- a/tests/typ/library/pad.typ
+++ b/tests/typ/library/pad.typ
@@ -5,9 +5,9 @@
#pad(left: 10pt, [Indented!])
// All sides together.
-#box(color: #9feb52,
+#rect(fill: #9feb52,
pad(10pt, right: 20pt,
- box(color: #eb5278, width: 20pt, height: 20pt)))
+ rect(width: 20pt, height: 20pt, fill: #eb5278)))
-// Error: 13-23 missing argument: body
-Hi #box(pad(left: 10pt)) there
+// Error: 14-24 missing argument: body
+Hi #rect(pad(left: 10pt)) there
diff --git a/tests/typ/library/shapes.typ b/tests/typ/library/shapes.typ
index efb68edf..c5a8abf9 100644
--- a/tests/typ/library/shapes.typ
+++ b/tests/typ/library/shapes.typ
@@ -1,31 +1,33 @@
// Test shapes.
---
+// Test `rect` function.
+
#page("a8", flip: true)
-// Box with fixed width, should have text height.
-#box(width: 2cm, color: #9650D6)[Legal]
+// Fixed width, should have text height.
+#rect(width: 2cm, fill: #9650D6)[Legal]
Sometimes there is no box.
-// Box with fixed height, should span line.
-#box(height: 1cm, width: 100%, color: #734CED)[B]
+// Fixed height, should span line.
+#rect(height: 1cm, width: 100%, fill: #734CED)[B]
-// Empty box with fixed width and height.
-#box(width: 6cm, height: 12pt, color: #CB4CED)
+// Empty with fixed width and height.
+#rect(width: 6cm, height: 12pt, fill: #CB4CED)
// Not visible, but creates a gap between the boxes above and below.
-#box(width: 2in, color: #ff0000)
+#rect(width: 2in, fill: #ff0000)
// These are in a row!
-#box(width: 0.5in, height: 10pt, color: #D6CD67)
-#box(width: 0.5in, height: 10pt, color: #EDD466)
-#box(width: 0.5in, height: 10pt, color: #E3BE62)
+#rect(width: 0.5in, height: 10pt, fill: #D6CD67)
+#rect(width: 0.5in, height: 10pt, fill: #EDD466)
+#rect(width: 0.5in, height: 10pt, fill: #E3BE62)
---
-// Make sure that you can't do page related stuff in a box.
+// Make sure that you can't do page related stuff in a shape.
A
-#box[
+#rect[
B
// Error: 16 cannot modify page from here
#pagebreak()
diff --git a/tests/typ/markup/emph.typ b/tests/typ/markup/emph.typ
index 772e15ab..500381c1 100644
--- a/tests/typ/markup/emph.typ
+++ b/tests/typ/markup/emph.typ
@@ -8,7 +8,7 @@ _Emphasized!_
Partly em_phas_ized.
// Scoped to body.
-#box[_Scoped] to body.
+#rect[_Scoped] to body.
// Unterminated is fine.
_The End
diff --git a/tests/typ/markup/heading.typ b/tests/typ/markup/heading.typ
index 8497ec8f..15c391d1 100644
--- a/tests/typ/markup/heading.typ
+++ b/tests/typ/markup/heading.typ
@@ -21,7 +21,7 @@
}
// Function call continues heading.
-= #box[
+= #rect[
A
] B
@@ -35,7 +35,7 @@ B
// Parsed as headings if at start of the context.
/**/ = Ok
{[== Ok]}
-#box[=== Ok]
+#rect[=== Ok]
// Not at the start of the context.
No = heading
diff --git a/tests/typ/markup/strong.typ b/tests/typ/markup/strong.typ
index b02a55a5..a56e0e1c 100644
--- a/tests/typ/markup/strong.typ
+++ b/tests/typ/markup/strong.typ
@@ -8,7 +8,7 @@
Partly str*ength*ened.
// Scoped to body.
-#box[*Scoped] to body.
+#rect[*Scoped] to body.
// Unterminated is fine.
*The End
diff --git a/tests/typ/repr.typ b/tests/typ/repr.typ
index 96eb710e..cf137745 100644
--- a/tests/typ/repr.typ
+++ b/tests/typ/repr.typ
@@ -52,6 +52,6 @@
// Functions
#let f(x) = x
-{box} \
+{rect} \
{f} \
{() => none} \