summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-03 22:48:54 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-03 22:48:54 +0100
commit34f839c7177a041c187ae6103455cd875c4f3d22 (patch)
treeab9da3f320f3e9bc71bf575c1477fb9a66da546e
parent193734f45385b179f40dc0145034204dad3cae8f (diff)
Improve tests 🔨
-rw-r--r--tests/ref/library/rgb.pngbin2079 -> 0 bytes
-rw-r--r--tests/typ/expr/call.typ1
-rw-r--r--tests/typ/expr/closure.typ4
-rw-r--r--tests/typ/library/box.typ3
-rw-r--r--tests/typ/library/font.typ3
-rw-r--r--tests/typ/library/hv.typ3
-rw-r--r--tests/typ/library/image.typ3
-rw-r--r--tests/typ/library/page.typ3
-rw-r--r--tests/typ/library/pagebreak.typ3
-rw-r--r--tests/typ/library/rgb.typ32
10 files changed, 38 insertions, 17 deletions
diff --git a/tests/ref/library/rgb.png b/tests/ref/library/rgb.png
deleted file mode 100644
index 37aef599..00000000
--- a/tests/ref/library/rgb.png
+++ /dev/null
Binary files differ
diff --git a/tests/typ/expr/call.typ b/tests/typ/expr/call.typ
index 358322d1..0e941124 100644
--- a/tests/typ/expr/call.typ
+++ b/tests/typ/expr/call.typ
@@ -54,7 +54,6 @@
---
// Different forms of template arguments.
-// Ref: true
#let a = "a"
diff --git a/tests/typ/expr/closure.typ b/tests/typ/expr/closure.typ
index d05acaa4..86a6f632 100644
--- a/tests/typ/expr/closure.typ
+++ b/tests/typ/expr/closure.typ
@@ -1,7 +1,7 @@
// Test closures.
+// Ref: false
---
-// Ref: false
// Basic closure without captures.
{
@@ -45,8 +45,6 @@
}
---
-// Ref: false
-
// Too few arguments.
{
let types(x, y) = "[" + type(x) + ", " + type(y) + "]"
diff --git a/tests/typ/library/box.typ b/tests/typ/library/box.typ
index eff0be3d..10e2c93e 100644
--- a/tests/typ/library/box.typ
+++ b/tests/typ/library/box.typ
@@ -1,3 +1,6 @@
+// Test the box function.
+
+---
#page("a7", flip: true)
// Box with fixed width, should have text height.
diff --git a/tests/typ/library/font.typ b/tests/typ/library/font.typ
index 165bdc10..157557fe 100644
--- a/tests/typ/library/font.typ
+++ b/tests/typ/library/font.typ
@@ -1,3 +1,6 @@
+// Test the font function.
+
+---
// Test configuring font properties.
// Set same font size in three different ways.
diff --git a/tests/typ/library/hv.typ b/tests/typ/library/hv.typ
index 154445cf..09132a60 100644
--- a/tests/typ/library/hv.typ
+++ b/tests/typ/library/hv.typ
@@ -1,3 +1,6 @@
+// Test the h and v functions.
+
+---
// Ends paragraphs.
Tightly #v(-5pt) packed
diff --git a/tests/typ/library/image.typ b/tests/typ/library/image.typ
index 9c3cd4fe..d3e6c78d 100644
--- a/tests/typ/library/image.typ
+++ b/tests/typ/library/image.typ
@@ -1,3 +1,6 @@
+// Test the image function.
+
+---
// Test loading different image formats.
// Load an RGBA PNG image.
diff --git a/tests/typ/library/page.typ b/tests/typ/library/page.typ
index b7ac0348..1f16f009 100644
--- a/tests/typ/library/page.typ
+++ b/tests/typ/library/page.typ
@@ -1,3 +1,6 @@
+// Test the page function.
+
+---
// Test configuring page sizes and margins.
// Set width and height.
diff --git a/tests/typ/library/pagebreak.typ b/tests/typ/library/pagebreak.typ
index dc3e5682..22af9512 100644
--- a/tests/typ/library/pagebreak.typ
+++ b/tests/typ/library/pagebreak.typ
@@ -1,3 +1,6 @@
+// Test the pagebreak function.
+
+---
First of two
#pagebreak()
#page(height: 40pt)
diff --git a/tests/typ/library/rgb.typ b/tests/typ/library/rgb.typ
index b962bbc0..62a1627c 100644
--- a/tests/typ/library/rgb.typ
+++ b/tests/typ/library/rgb.typ
@@ -1,17 +1,23 @@
-// Check the output.
-#rgb(0.0, 0.3, 0.7)
+// Test the rgb function.
+// Ref: false
-// Alpha channel.
-#rgb(1.0, 0.0, 0.0, 0.5)
+---
+{
+ // Check the output.
+ test(rgb(0.0, 0.3, 0.7), #004db3)
-// Warning: 2:6-2:9 should be between 0.0 and 1.0
-// Warning: 1:11-1:15 should be between 0.0 and 1.0
-#rgb(-30, 15.5, 0.5)
+ // Alpha channel.
+ test(rgb(1.0, 0.0, 0.0, 0.5), #ff000080)
-// Error: 6-10 missing argument: blue component
-#rgb(0, 1)
+ // Warning: 2:14-2:17 should be between 0.0 and 1.0
+ // Warning: 1:19-1:23 should be between 0.0 and 1.0
+ test(rgb(-30, 15.5, 0.5), #00ff80)
-// Error: 3:6-3:6 missing argument: red component
-// Error: 2:6-2:6 missing argument: green component
-// Error: 1:6-1:6 missing argument: blue component
-#rgb()
+ // Error: 14-18 missing argument: blue component
+ test(rgb(0, 1), #00ff00)
+
+ // Error: 3:14-3:14 missing argument: red component
+ // Error: 2:14-2:14 missing argument: green component
+ // Error: 1:14-1:14 missing argument: blue component
+ test(rgb(), #000000)
+}