summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-10 16:46:01 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-10 16:46:01 +0200
commit5611c26577c4cf6d52b9b66b7b1a32253aa23ec1 (patch)
treeb06a64845ef691700aed7fd0ed1e22dd064cc742
parentbce553a991f19b2b5bb9efef6b74bd12e15a10c6 (diff)
Restructure tests
-rw-r--r--tests/ref/code/repr.pngbin10838 -> 10896 bytes
-rw-r--r--tests/ref/coma.png (renamed from tests/ref/full/coma.png)bin59057 -> 59057 bytes
-rw-r--r--tests/ref/insert/circle.png (renamed from tests/ref/library/circle.png)bin13518 -> 13518 bytes
-rw-r--r--tests/ref/insert/ellipse.png (renamed from tests/ref/library/ellipse.png)bin7608 -> 7608 bytes
-rw-r--r--tests/ref/insert/image.png (renamed from tests/ref/library/image.png)bin219513 -> 219513 bytes
-rw-r--r--tests/ref/insert/rect.png (renamed from tests/ref/library/rect.png)bin2750 -> 2750 bytes
-rw-r--r--tests/ref/insert/square.png (renamed from tests/ref/library/square.png)bin7163 -> 7163 bytes
-rw-r--r--tests/ref/layout/grid-1.png (renamed from tests/ref/library/grid.png)bin4673 -> 4673 bytes
-rw-r--r--tests/ref/layout/grid-2.png (renamed from tests/ref/library/grid-table.png)bin10495 -> 10495 bytes
-rw-r--r--tests/ref/layout/pad.png (renamed from tests/ref/library/pad.png)bin1226 -> 1226 bytes
-rw-r--r--tests/ref/layout/page.png (renamed from tests/ref/library/page.png)bin7432 -> 7432 bytes
-rw-r--r--tests/ref/layout/pagebreak.png (renamed from tests/ref/library/pagebreak.png)bin1368 -> 1368 bytes
-rw-r--r--tests/ref/layout/spacing.png (renamed from tests/ref/library/spacing.png)bin3247 -> 3247 bytes
-rw-r--r--tests/ref/layout/stack.png (renamed from tests/ref/library/stack.png)bin264 -> 264 bytes
-rw-r--r--tests/ref/library/lang.pngbin1898 -> 0 bytes
-rw-r--r--tests/ref/markup/basic.pngbin3464 -> 0 bytes
-rw-r--r--tests/ref/markup/linebreak.pngbin0 -> 593 bytes
-rw-r--r--tests/ref/markup/shorthands.pngbin0 -> 2122 bytes
-rw-r--r--tests/ref/text/bidi.pngbin15004 -> 15024 bytes
-rw-r--r--tests/ref/text/font.png (renamed from tests/ref/library/font.png)bin21435 -> 21435 bytes
-rw-r--r--tests/ref/text/par.png (renamed from tests/ref/library/paragraph.png)bin4337 -> 4337 bytes
-rw-r--r--tests/typ/code/repr.typ14
-rw-r--r--tests/typ/coma.typ (renamed from tests/typ/full/coma.typ)2
-rw-r--r--tests/typ/insert/circle.typ (renamed from tests/typ/library/circle.typ)0
-rw-r--r--tests/typ/insert/ellipse.typ (renamed from tests/typ/library/ellipse.typ)0
-rw-r--r--tests/typ/insert/image.typ (renamed from tests/typ/library/image.typ)4
-rw-r--r--tests/typ/insert/rect.typ (renamed from tests/typ/library/rect.typ)0
-rw-r--r--tests/typ/insert/square.typ (renamed from tests/typ/library/square.typ)0
-rw-r--r--tests/typ/layout/grid-1.typ (renamed from tests/typ/library/grid.typ)2
-rw-r--r--tests/typ/layout/grid-2.typ (renamed from tests/typ/library/grid-table.typ)0
-rw-r--r--tests/typ/layout/pad.typ (renamed from tests/typ/library/pad.typ)0
-rw-r--r--tests/typ/layout/page.typ (renamed from tests/typ/library/page.typ)4
-rw-r--r--tests/typ/layout/pagebreak.typ (renamed from tests/typ/library/pagebreak.typ)2
-rw-r--r--tests/typ/layout/spacing.typ (renamed from tests/typ/library/spacing.typ)0
-rw-r--r--tests/typ/layout/stack.typ (renamed from tests/typ/library/stack.typ)2
-rw-r--r--tests/typ/library/lang.typ16
-rw-r--r--tests/typ/markup/basic.typ12
-rw-r--r--tests/typ/markup/linebreak.typ4
-rw-r--r--tests/typ/markup/shorthands.typ7
-rw-r--r--tests/typ/text/bidi.typ17
-rw-r--r--tests/typ/text/font.typ (renamed from tests/typ/library/font.typ)4
-rw-r--r--tests/typ/text/par.typ (renamed from tests/typ/library/paragraph.typ)4
-rw-r--r--tests/typ/utility/calc.typ (renamed from tests/typ/library/math.typ)2
-rw-r--r--tests/typ/utility/color.typ (renamed from tests/typ/library/basic.typ)6
44 files changed, 44 insertions, 58 deletions
diff --git a/tests/ref/code/repr.png b/tests/ref/code/repr.png
index b93677f1..bc29db54 100644
--- a/tests/ref/code/repr.png
+++ b/tests/ref/code/repr.png
Binary files differ
diff --git a/tests/ref/full/coma.png b/tests/ref/coma.png
index 2d067364..2d067364 100644
--- a/tests/ref/full/coma.png
+++ b/tests/ref/coma.png
Binary files differ
diff --git a/tests/ref/library/circle.png b/tests/ref/insert/circle.png
index 8364d42b..8364d42b 100644
--- a/tests/ref/library/circle.png
+++ b/tests/ref/insert/circle.png
Binary files differ
diff --git a/tests/ref/library/ellipse.png b/tests/ref/insert/ellipse.png
index 2e52b515..2e52b515 100644
--- a/tests/ref/library/ellipse.png
+++ b/tests/ref/insert/ellipse.png
Binary files differ
diff --git a/tests/ref/library/image.png b/tests/ref/insert/image.png
index 0a45e11b..0a45e11b 100644
--- a/tests/ref/library/image.png
+++ b/tests/ref/insert/image.png
Binary files differ
diff --git a/tests/ref/library/rect.png b/tests/ref/insert/rect.png
index 5f6df7b6..5f6df7b6 100644
--- a/tests/ref/library/rect.png
+++ b/tests/ref/insert/rect.png
Binary files differ
diff --git a/tests/ref/library/square.png b/tests/ref/insert/square.png
index def2e664..def2e664 100644
--- a/tests/ref/library/square.png
+++ b/tests/ref/insert/square.png
Binary files differ
diff --git a/tests/ref/library/grid.png b/tests/ref/layout/grid-1.png
index f7dda520..f7dda520 100644
--- a/tests/ref/library/grid.png
+++ b/tests/ref/layout/grid-1.png
Binary files differ
diff --git a/tests/ref/library/grid-table.png b/tests/ref/layout/grid-2.png
index 36837663..36837663 100644
--- a/tests/ref/library/grid-table.png
+++ b/tests/ref/layout/grid-2.png
Binary files differ
diff --git a/tests/ref/library/pad.png b/tests/ref/layout/pad.png
index 0bf0adde..0bf0adde 100644
--- a/tests/ref/library/pad.png
+++ b/tests/ref/layout/pad.png
Binary files differ
diff --git a/tests/ref/library/page.png b/tests/ref/layout/page.png
index dfe6f8cd..dfe6f8cd 100644
--- a/tests/ref/library/page.png
+++ b/tests/ref/layout/page.png
Binary files differ
diff --git a/tests/ref/library/pagebreak.png b/tests/ref/layout/pagebreak.png
index b671605c..b671605c 100644
--- a/tests/ref/library/pagebreak.png
+++ b/tests/ref/layout/pagebreak.png
Binary files differ
diff --git a/tests/ref/library/spacing.png b/tests/ref/layout/spacing.png
index 2205809a..2205809a 100644
--- a/tests/ref/library/spacing.png
+++ b/tests/ref/layout/spacing.png
Binary files differ
diff --git a/tests/ref/library/stack.png b/tests/ref/layout/stack.png
index 684905f7..684905f7 100644
--- a/tests/ref/library/stack.png
+++ b/tests/ref/layout/stack.png
Binary files differ
diff --git a/tests/ref/library/lang.png b/tests/ref/library/lang.png
deleted file mode 100644
index ecb8820a..00000000
--- a/tests/ref/library/lang.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/markup/basic.png b/tests/ref/markup/basic.png
deleted file mode 100644
index d769a209..00000000
--- a/tests/ref/markup/basic.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/markup/linebreak.png b/tests/ref/markup/linebreak.png
new file mode 100644
index 00000000..06f4d5f4
--- /dev/null
+++ b/tests/ref/markup/linebreak.png
Binary files differ
diff --git a/tests/ref/markup/shorthands.png b/tests/ref/markup/shorthands.png
new file mode 100644
index 00000000..3a5652ac
--- /dev/null
+++ b/tests/ref/markup/shorthands.png
Binary files differ
diff --git a/tests/ref/text/bidi.png b/tests/ref/text/bidi.png
index 0b7a8c2b..b90c6714 100644
--- a/tests/ref/text/bidi.png
+++ b/tests/ref/text/bidi.png
Binary files differ
diff --git a/tests/ref/library/font.png b/tests/ref/text/font.png
index 44183b3a..44183b3a 100644
--- a/tests/ref/library/font.png
+++ b/tests/ref/text/font.png
Binary files differ
diff --git a/tests/ref/library/paragraph.png b/tests/ref/text/par.png
index 41742f20..41742f20 100644
--- a/tests/ref/library/paragraph.png
+++ b/tests/ref/text/par.png
Binary files differ
diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ
index f2404510..eacbf8e8 100644
--- a/tests/typ/code/repr.typ
+++ b/tests/typ/code/repr.typ
@@ -2,7 +2,6 @@
---
// Variables.
-
#let name = "Typst"
#let ke-bab = "Kebab!"
#let α = "Alpha"
@@ -31,9 +30,7 @@
{4.5cm} \
{12e1pt} \
{2.5rad} \
-{45deg} \
-// Not in monospace via repr.
-#repr(45deg)
+{45deg}
---
// Colors.
@@ -55,3 +52,12 @@
{rect} \
{f} \
{() => none}
+
+---
+// Test using the `repr` function.
+
+// Returns a string.
+#test(repr((1, 2, false, )), "(1, 2, false)")
+
+// Not in monospace
+#repr(23deg)
diff --git a/tests/typ/full/coma.typ b/tests/typ/coma.typ
index 78a703a9..810d61b8 100644
--- a/tests/typ/full/coma.typ
+++ b/tests/typ/coma.typ
@@ -46,4 +46,4 @@ von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel.
// The `image` function returns a "template" value of the same type as
// the `[...]` literals.
-#align(center, image("../../res/graph.png", width: 75%))
+#align(center, image("../res/graph.png", width: 75%))
diff --git a/tests/typ/library/circle.typ b/tests/typ/insert/circle.typ
index d2fa928e..d2fa928e 100644
--- a/tests/typ/library/circle.typ
+++ b/tests/typ/insert/circle.typ
diff --git a/tests/typ/library/ellipse.typ b/tests/typ/insert/ellipse.typ
index 9b10eded..9b10eded 100644
--- a/tests/typ/library/ellipse.typ
+++ b/tests/typ/insert/ellipse.typ
diff --git a/tests/typ/library/image.typ b/tests/typ/insert/image.typ
index 1fa128f0..35087c2e 100644
--- a/tests/typ/library/image.typ
+++ b/tests/typ/insert/image.typ
@@ -13,8 +13,8 @@
// Error: 8-29 file not found
#image("path/does/not/exist")
-// Error: 8-20 failed to load image
-#image("./font.typ")
+// Error: 8-21 failed to load image
+#image("./image.typ")
---
// Test configuring the size and fitting behaviour of images.
diff --git a/tests/typ/library/rect.typ b/tests/typ/insert/rect.typ
index f450064a..f450064a 100644
--- a/tests/typ/library/rect.typ
+++ b/tests/typ/insert/rect.typ
diff --git a/tests/typ/library/square.typ b/tests/typ/insert/square.typ
index 649d31c0..649d31c0 100644
--- a/tests/typ/library/square.typ
+++ b/tests/typ/insert/square.typ
diff --git a/tests/typ/library/grid.typ b/tests/typ/layout/grid-1.typ
index afb43684..6a4aee87 100644
--- a/tests/typ/library/grid.typ
+++ b/tests/typ/layout/grid-1.typ
@@ -1,4 +1,4 @@
-// Test the `grid` function.
+// Test grid layouts.
---
#let rect(width, color) = rect(width: width, height: 2cm, fill: color)
diff --git a/tests/typ/library/grid-table.typ b/tests/typ/layout/grid-2.typ
index 277e695c..277e695c 100644
--- a/tests/typ/library/grid-table.typ
+++ b/tests/typ/layout/grid-2.typ
diff --git a/tests/typ/library/pad.typ b/tests/typ/layout/pad.typ
index 3726ce53..3726ce53 100644
--- a/tests/typ/library/pad.typ
+++ b/tests/typ/layout/pad.typ
diff --git a/tests/typ/library/page.typ b/tests/typ/layout/page.typ
index 7f9a0d2c..cf787e5d 100644
--- a/tests/typ/library/page.typ
+++ b/tests/typ/layout/page.typ
@@ -1,8 +1,6 @@
-// Test the `page` function.
-
----
// Test configuring page sizes and margins.
+---
// Set width and height.
#page(width: 120pt, height: 120pt)
#page(width: 40pt)[High]
diff --git a/tests/typ/library/pagebreak.typ b/tests/typ/layout/pagebreak.typ
index 26629f4b..bb7013ab 100644
--- a/tests/typ/library/pagebreak.typ
+++ b/tests/typ/layout/pagebreak.typ
@@ -1,4 +1,4 @@
-// Test the `pagebreak` function.
+// Test forced page breaks.
---
First of two
diff --git a/tests/typ/library/spacing.typ b/tests/typ/layout/spacing.typ
index bd38631e..bd38631e 100644
--- a/tests/typ/library/spacing.typ
+++ b/tests/typ/layout/spacing.typ
diff --git a/tests/typ/library/stack.typ b/tests/typ/layout/stack.typ
index d03a95c8..006a1412 100644
--- a/tests/typ/library/stack.typ
+++ b/tests/typ/layout/stack.typ
@@ -1,4 +1,4 @@
-// Test the `stack` function.
+// Test stack layouts.
---
#let rect(width, color) = rect(width: width, height: 1cm, fill: color)
diff --git a/tests/typ/library/lang.typ b/tests/typ/library/lang.typ
deleted file mode 100644
index 87d2c154..00000000
--- a/tests/typ/library/lang.typ
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test the `lang` function.
-
----
-Left to right.
-
-#lang("ar")
-Right to left.
-
-#lang(dir: ltr)
-Back again.
-
----
-// Ref: false
-
-// Error: 12-15 must be horizontal
-#lang(dir: ttb)
diff --git a/tests/typ/markup/basic.typ b/tests/typ/markup/basic.typ
deleted file mode 100644
index 01582ceb..00000000
--- a/tests/typ/markup/basic.typ
+++ /dev/null
@@ -1,12 +0,0 @@
-// Test basic markup.
-
----
-A \ B \ C
-
----
-Paragraph breaks
-
-for you!
-
----
-The non-breaking~space does work.
diff --git a/tests/typ/markup/linebreak.typ b/tests/typ/markup/linebreak.typ
new file mode 100644
index 00000000..7fe8a718
--- /dev/null
+++ b/tests/typ/markup/linebreak.typ
@@ -0,0 +1,4 @@
+// Test line breaks.
+
+---
+A \ B \ C
diff --git a/tests/typ/markup/shorthands.typ b/tests/typ/markup/shorthands.typ
new file mode 100644
index 00000000..38471c9d
--- /dev/null
+++ b/tests/typ/markup/shorthands.typ
@@ -0,0 +1,7 @@
+// Test shorthands for unicode codepoints.
+
+---
+The non-breaking~space does work.
+
+---
+En dash: --
diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ
index 0d589930..078cb1f9 100644
--- a/tests/typ/text/bidi.typ
+++ b/tests/typ/text/bidi.typ
@@ -1,27 +1,27 @@
-// Test bidirectional text.
+// Test bidirectional text and language configuration.
---
// Test reordering with different top-level paragraph directions.
#let text = [Text טֶקסט]
#font("EB Garamond", "Noto Serif Hebrew")
-#lang("de") {text}
#lang("he") {text}
+#lang("de") {text}
---
-// Test that consecutiv, embedded LTR runs stay LTR.
+// Test that consecutive, embedded LTR runs stay LTR.
// Here, we have two runs: "A" and italic "B".
#let text = [أنت A_B_مطرC]
#font("EB Garamond", "Noto Sans Arabic")
-#lang("de") {text}
#lang("ar") {text}
+#lang("de") {text}
---
// Test that consecutive, embedded RTL runs stay RTL.
// Here, we have three runs: "גֶ", bold "שֶׁ", and "ם".
#let text = [Aגֶ*שֶׁ*םB]
#font("EB Garamond", "Noto Serif Hebrew")
-#lang("de") {text}
#lang("he") {text}
+#lang("de") {text}
---
// Test embedding up to level 4 with isolates.
@@ -47,3 +47,10 @@ Lריווח #h(1cm) R
#font("Noto Serif Hebrew", "EB Garamond")
#lang("he")
קרנפיםRh#image("../../res/rhino.png", height: 11pt)inoחיים
+
+---
+// Test the `lang` function.
+// Ref: false
+
+// Error: 12-15 must be horizontal
+#lang(dir: ttb)
diff --git a/tests/typ/library/font.typ b/tests/typ/text/font.typ
index 34b08f26..317037e2 100644
--- a/tests/typ/library/font.typ
+++ b/tests/typ/text/font.typ
@@ -1,8 +1,6 @@
-// Test the `font` function.
-
----
// Test configuring font properties.
+---
// Set same font size in three different ways.
#font(22pt)[A]
#font(200%)[A]
diff --git a/tests/typ/library/paragraph.typ b/tests/typ/text/par.typ
index a26aed84..4ce2f6f1 100644
--- a/tests/typ/library/paragraph.typ
+++ b/tests/typ/text/par.typ
@@ -1,8 +1,6 @@
-// Test the `paragraph` function.
-
----
// Test configuring paragraph properties.
+---
// FIXME: Word spacing doesn't work due to new shaping process.
#par(spacing: 10pt, leading: 25%, word-spacing: 1pt)
diff --git a/tests/typ/library/math.typ b/tests/typ/utility/calc.typ
index db234d9c..3bfc9802 100644
--- a/tests/typ/library/math.typ
+++ b/tests/typ/utility/calc.typ
@@ -1,4 +1,4 @@
-// Test math functions.
+// Test basic calculation functions.
// Ref: false
---
diff --git a/tests/typ/library/basic.typ b/tests/typ/utility/color.typ
index a6aa71af..2e40828b 100644
--- a/tests/typ/library/basic.typ
+++ b/tests/typ/utility/color.typ
@@ -1,11 +1,7 @@
-// Test basic functions.
+// Test color creation functions.
// Ref: false
---
-#test(type("hi"), "string")
-#test(repr((1, 2, false, )), "(1, 2, false)")
-
----
// Check the output.
#test(rgb(0.0, 0.3, 0.7), #004db3)