summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/compute/data.typ13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/typ/compute/data.typ b/tests/typ/compute/data.typ
index c0a6ce50..ae964b3d 100644
--- a/tests/typ/compute/data.typ
+++ b/tests/typ/compute/data.typ
@@ -23,6 +23,14 @@
#table(columns: data.at(0).len(), ..cells)
---
+// Test reading CSV data with dictionary rows enabled.
+#let data = csv("/files/zoo.csv", row-type: dictionary)
+#test(data.len(), 3)
+#test(data.at(0).Name, "Debby")
+#test(data.at(2).Weight, "150kg")
+#test(data.at(1).Species, "Tiger")
+
+---
// Error: 6-16 file not found (searched at typ/compute/nope.csv)
#csv("nope.csv")
@@ -31,6 +39,11 @@
#csv("/files/bad.csv")
---
+// Test error numbering with dictionary rows.
+// Error: 6-22 failed to parse CSV (found 3 instead of 2 fields in line 3)
+#csv("/files/bad.csv", row-type: dictionary)
+
+---
// Test reading JSON data.
#let data = json("/files/zoo.json")
#test(data.len(), 3)