summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-12 22:55:26 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-12 22:55:26 +0100
commit790dc9e6670b0d90c9ff68a0981cdbfb7d9c536a (patch)
treeaf12c6da8b32a0e54c9dfe005b6076d764804d9c /tests
parenta2fcc1bf288c5162de7b2158166de62cb0610083 (diff)
Cleaning ๐Ÿงน
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/ref/call-args.pngbin3295 -> 3432 bytes
-rw-r--r--tests/lang/ref/call-bracket.pngbin1611 -> 12516 bytes
-rw-r--r--tests/lang/ref/call-chain.pngbin8692 -> 0 bytes
-rw-r--r--tests/lang/ref/call-invalid.pngbin1706 -> 1766 bytes
-rw-r--r--tests/lang/ref/comment.pngbin1168 -> 682 bytes
-rw-r--r--tests/lang/ref/repr.pngbin8355 -> 8451 bytes
-rw-r--r--tests/lang/typ/call-bracket.typ38
-rw-r--r--tests/lang/typ/call-chain.typ31
-rw-r--r--tests/lang/typ/comment.typ4
-rw-r--r--tests/lang/typ/expr-binary.typ1
-rw-r--r--tests/lang/typ/repr.typ2
-rw-r--r--tests/library/ref/box.pngbin5087 -> 2704 bytes
-rw-r--r--tests/library/typ/box.typ25
13 files changed, 48 insertions, 53 deletions
diff --git a/tests/lang/ref/call-args.png b/tests/lang/ref/call-args.png
index 99acd84b..b288be22 100644
--- a/tests/lang/ref/call-args.png
+++ b/tests/lang/ref/call-args.png
Binary files differ
diff --git a/tests/lang/ref/call-bracket.png b/tests/lang/ref/call-bracket.png
index 347907b8..b5b2f767 100644
--- a/tests/lang/ref/call-bracket.png
+++ b/tests/lang/ref/call-bracket.png
Binary files differ
diff --git a/tests/lang/ref/call-chain.png b/tests/lang/ref/call-chain.png
deleted file mode 100644
index de5520b8..00000000
--- a/tests/lang/ref/call-chain.png
+++ /dev/null
Binary files differ
diff --git a/tests/lang/ref/call-invalid.png b/tests/lang/ref/call-invalid.png
index a60e037f..0bceebc1 100644
--- a/tests/lang/ref/call-invalid.png
+++ b/tests/lang/ref/call-invalid.png
Binary files differ
diff --git a/tests/lang/ref/comment.png b/tests/lang/ref/comment.png
index 0ab9a988..7ab48b3a 100644
--- a/tests/lang/ref/comment.png
+++ b/tests/lang/ref/comment.png
Binary files differ
diff --git a/tests/lang/ref/repr.png b/tests/lang/ref/repr.png
index 110e26c0..16c7ea95 100644
--- a/tests/lang/ref/repr.png
+++ b/tests/lang/ref/repr.png
Binary files differ
diff --git a/tests/lang/typ/call-bracket.typ b/tests/lang/typ/call-bracket.typ
index 2ee2c5d4..eb097094 100644
--- a/tests/lang/typ/call-bracket.typ
+++ b/tests/lang/typ/call-bracket.typ
@@ -1,11 +1,11 @@
// Test bracketed function calls.
---
-// Whitespace insignificant.
-#[f], #[ f ]
+// Whitespace is insignificant.
+#[ f ]
-// Body and no body.
-#[f][#[f]]
+// Alternatives for embedding.
+#[f f()], #[f #[f]], #[f][#[f]],
// Tight functions.
#[f]#[f]
@@ -16,3 +16,33 @@
Second
]
+
+---
+// Chained once.
+#[f | f]
+
+// Chained twice.
+#[f|f|f]
+
+// With body.
+// Error: 7-8 expected identifier, found integer
+#[f | 1 | box][๐Ÿ’•]
+
+// With actual functions.
+#[box width: 1cm | image "res/rhino.png"]
+
+---
+// Error: 8-8 expected identifier
+#[f 1 |]
+
+// Error: 4-4 expected identifier
+#[ | f true]
+
+// Error: 2:3-2:3 expected identifier
+// Error: 1:4-1:4 expected identifier
+#[|][Nope]
+
+// Pipe wins over parens.
+// Error: 2:6-2:6 expected closing paren
+// Error: 1:9-1:10 expected expression, found closing paren
+#[f (|f )]
diff --git a/tests/lang/typ/call-chain.typ b/tests/lang/typ/call-chain.typ
deleted file mode 100644
index 72899f95..00000000
--- a/tests/lang/typ/call-chain.typ
+++ /dev/null
@@ -1,31 +0,0 @@
-// Test bracket call chaining.
-
----
-// Chained once.
-#[f | f]
-
-// Chained twice.
-#[f|f|f]
-
-// With body.
-// Error: 7-8 expected identifier, found integer
-#[f | 1 | box][๐Ÿ’•]
-
-// With actual functions.
-#[box width: 1cm | image "res/rhino.png"]
-
----
-// Error: 8-8 expected identifier
-#[f 1 |]
-
-// Error: 4-4 expected identifier
-#[ | f true]
-
-// Error: 2:3-2:3 expected identifier
-// Error: 1:4-1:4 expected identifier
-#[|][Nope]
-
-// Pipe wins over parens.
-// Error: 2:6-2:6 expected closing paren
-// Error: 1:9-1:10 expected expression, found closing paren
-#[f (|f )]
diff --git a/tests/lang/typ/comment.typ b/tests/lang/typ/comment.typ
index 524a24e3..8b394f1f 100644
--- a/tests/lang/typ/comment.typ
+++ b/tests/lang/typ/comment.typ
@@ -11,8 +11,8 @@ C/*
*/D
// Works in code.
-#[f /*1*/ a: "b" //
-, 1]
+#[test type /*1*/ (1) //
+, "integer"]
---
// End should not appear without start.
diff --git a/tests/lang/typ/expr-binary.typ b/tests/lang/typ/expr-binary.typ
index b0226998..e84cb282 100644
--- a/tests/lang/typ/expr-binary.typ
+++ b/tests/lang/typ/expr-binary.typ
@@ -54,7 +54,6 @@
}
}
-
// Make sure length, relative and linear
// - can all be added to / subtracted from each other,
// - multiplied with integers and floats,
diff --git a/tests/lang/typ/repr.typ b/tests/lang/typ/repr.typ
index 1975a8e6..6229165a 100644
--- a/tests/lang/typ/repr.typ
+++ b/tests/lang/typ/repr.typ
@@ -44,4 +44,4 @@
---
// Templates.
-{[*{"Hi"} #[f 1]*]}
+{[*{"H" + "i"} there*]}
diff --git a/tests/library/ref/box.png b/tests/library/ref/box.png
index 37fd7d27..9827c6c3 100644
--- a/tests/library/ref/box.png
+++ b/tests/library/ref/box.png
Binary files differ
diff --git a/tests/library/typ/box.typ b/tests/library/typ/box.typ
index 03e5da54..67abe350 100644
--- a/tests/library/typ/box.typ
+++ b/tests/library/typ/box.typ
@@ -1,23 +1,20 @@
-#[page "a5", flip: true]
+#[page "a7", flip: true]
-// Rectangle with width, should have paragraph height
-#[box width: 2cm, color: #9650D6][aa]
+// Box with fixed width, should have text height.
+#[box width: 2cm, color: #9650D6][A]
-Sometimes there is no box
+Sometimes there is no box.
-// Rectangle with height, should span line
-#[box height: 2cm, width: 100%, color: #734CED][bb]
+// Box with fixed height, should span line.
+#[box height: 2cm, width: 100%, color: #734CED][B]
-// Empty rectangle with width and height
+// Empty box with fixed width and height.
#[box width: 6cm, height: 12pt, color: #CB4CED]
-// This empty rectangle should not be displayed
+// Not visiblem, but creates a gap between the boxes above and below.
#[box width: 2in, color: #ff0000]
-// This one should be
-#[box height: 15mm, width: 100%, color: #494DE3]
-
// These are in a row!
-#[box width: 2in, height: 10pt, color: #D6CD67]
-#[box width: 2in, height: 10pt, color: #EDD466]
-#[box width: 2in, height: 10pt, color: #E3BE62]
+#[box width: 1in, height: 10pt, color: #D6CD67]
+#[box width: 1in, height: 10pt, color: #EDD466]
+#[box width: 1in, height: 10pt, color: #E3BE62]