summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-09 14:05:57 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-09 22:44:40 +0200
commitbce553a991f19b2b5bb9efef6b74bd12e15a10c6 (patch)
treefa8ed4b3974927b30e6cffd0d71d4c3e980698de /tests
parent29cfef0a6dfef5820bda339d327638e285aaf4d3 (diff)
Tidy up
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/library/grid-table.pngbin0 -> 10495 bytes
-rw-r--r--tests/ref/library/grid.pngbin17246 -> 4673 bytes
-rw-r--r--tests/typ/library/grid-table.typ29
-rw-r--r--tests/typ/library/grid.typ53
4 files changed, 41 insertions, 41 deletions
diff --git a/tests/ref/library/grid-table.png b/tests/ref/library/grid-table.png
new file mode 100644
index 00000000..36837663
--- /dev/null
+++ b/tests/ref/library/grid-table.png
Binary files differ
diff --git a/tests/ref/library/grid.png b/tests/ref/library/grid.png
index 278ead89..f7dda520 100644
--- a/tests/ref/library/grid.png
+++ b/tests/ref/library/grid.png
Binary files differ
diff --git a/tests/typ/library/grid-table.typ b/tests/typ/library/grid-table.typ
new file mode 100644
index 00000000..277e695c
--- /dev/null
+++ b/tests/typ/library/grid-table.typ
@@ -0,0 +1,29 @@
+// Test using the `grid` function to create a finance table.
+
+---
+#page(width: 12cm, height: 2.5cm)
+#grid(
+ columns: 5,
+ gutter-columns: (2fr, 1fr, 1fr),
+ gutter-rows: 4 * (6pt,),
+ [*Quarter*],
+ [Expenditure],
+ [External Revenue],
+ [Financial ROI],
+ [_total_],
+ [*Q1*],
+ [173,472.57 \$],
+ [472,860.91 \$],
+ [51,286.84 \$],
+ [_350,675.18 \$_],
+ [*Q2*],
+ [93,382.12 \$],
+ [439,382.85 \$],
+ [-1,134.30 \$],
+ [_344,866.43 \$_],
+ [*Q3*],
+ [96,421.49 \$],
+ [238,583.54 \$],
+ [3,497.12 \$],
+ [_145,659.17 \$_],
+)
diff --git a/tests/typ/library/grid.typ b/tests/typ/library/grid.typ
index dcc0797f..afb43684 100644
--- a/tests/typ/library/grid.typ
+++ b/tests/typ/library/grid.typ
@@ -1,8 +1,9 @@
// Test the `grid` function.
---
-#page(width: 100pt, height: 140pt)
#let rect(width, color) = rect(width: width, height: 2cm, fill: color)
+
+#page(width: 100pt, height: 140pt)
#grid(
columns: (auto, 1fr, 3fr, 0.25cm, 3%, 2mm + 10%),
rect(0.5cm, #2a631a),
@@ -22,15 +23,6 @@
#grid()
---
-
-#grid(
- columns: (auto, auto, 40%),
- gutter: (1fr,),
- rect(fill: eastern)[dddaa aaa aaa],
- rect(fill: conifer)[ccc],
- rect(width: 100%, fill: #dddddd)[aaa],
-)
-
#grid(
columns: (auto, auto, 40%),
gutter: (1fr,),
@@ -39,41 +31,11 @@
rect(width: 100%, fill: #dddddd)[aaa],
)
-
----
-
-#page(width: 12cm, height: 2.5cm)
-#grid(
- columns: (auto, auto, auto, auto, auto),
- gutter-col: (2fr, 1fr, 1fr),
- gutter-row: (6pt, 6pt, 6pt, 6pt),
- [*Quarter*],
- [Expenditure],
- [External Revenue],
- [Financial ROI],
- [_total_],
- [*Q1*],
- [173,472.57 \$],
- [472,860.91 \$],
- [51,286.84 \$],
- [_350,675.18 \$_],
- [*Q2*],
- [93,382.12 \$],
- [439,382.85 \$],
- [-1,134.30 \$],
- [_344,866.43 \$_],
- [*Q3*],
- [96,421.49 \$],
- [238,583.54 \$],
- [3,497.12 \$],
- [_145,659.17 \$_],
-)
-
---
#page(height: 3cm, width: 2cm)
#grid(
- dir: ttb,
columns: (1fr, 1cm, 1fr, 1fr),
+ column-dir: ttb,
rows: (auto, 1fr),
rect(height: 100%, fill: #222222)[foo],
rect(height: 100%, fill: #547d0a)[bar],
@@ -81,3 +43,12 @@
rect(height: 100%, fill: conifer)[baz],
rect(height: 100%, width: 100%, fill: #547d0a)[bar],
)
+
+---
+#page(height: 3cm, margins: 0pt)
+#align(center)
+#grid(
+ columns: (1fr,),
+ rows: (1fr, auto, 2fr),
+ [], rect(width: 100%)[A bit more to the top], [],
+)