summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-07-27 00:09:15 +0200
committerLaurenz <laurmaedje@gmail.com>2022-07-27 00:09:15 +0200
commit9362c279de362eac1b7ec76834dd76a0235c5dd2 (patch)
treefdcec0de57deac0f94c2b4521ff09e94b1c785ee /tests/typ
parentfc574b39454aec77cf2c33270566225917c7c823 (diff)
CSV reading
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/utility/csv.typ15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/typ/utility/csv.typ b/tests/typ/utility/csv.typ
new file mode 100644
index 00000000..ab955ab0
--- /dev/null
+++ b/tests/typ/utility/csv.typ
@@ -0,0 +1,15 @@
+// Test reading structured CSV data.
+
+---
+#set page(width: auto)
+#let data = csv("/res/zoo.csv")
+#let cells = data(0).map(strong) + data.slice(1).flatten()
+#table(columns: data(0).len(), ..cells)
+
+---
+// Error: 6-16 file not found (searched at typ/utility/nope.csv)
+#csv("nope.csv")
+
+---
+// Error: 6-20 failed to load csv file (CSV error: record 2 (line: 3, byte: 8): found record with 3 fields, but the previous record has 2 fields)
+#csv("/res/bad.csv")