Improve tests 🔨

This commit is contained in:
Laurenz 2021-03-03 22:48:54 +01:00
parent 193734f453
commit 34f839c717
10 changed files with 38 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -54,7 +54,6 @@
---
// Different forms of template arguments.
// Ref: true
#let a = "a"

View File

@ -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) + "]"

View File

@ -1,3 +1,6 @@
// Test the box function.
---
#page("a7", flip: true)
// Box with fixed width, should have text height.

View File

@ -1,3 +1,6 @@
// Test the font function.
---
// Test configuring font properties.
// Set same font size in three different ways.

View File

@ -1,3 +1,6 @@
// Test the h and v functions.
---
// Ends paragraphs.
Tightly #v(-5pt) packed

View File

@ -1,3 +1,6 @@
// Test the image function.
---
// Test loading different image formats.
// Load an RGBA PNG image.

View File

@ -1,3 +1,6 @@
// Test the page function.
---
// Test configuring page sizes and margins.
// Set width and height.

View File

@ -1,3 +1,6 @@
// Test the pagebreak function.
---
First of two
#pagebreak()
#page(height: 40pt)

View File

@ -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)
}