diff options
| author | Niklas Ausborn <niklas@ausborn.de> | 2023-12-18 17:14:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-18 17:14:21 +0100 |
| commit | 1f983ced90f1660958eb9ec9854dbbc2b3aa3509 (patch) | |
| tree | 14f7660aa4d04c6f4decc32903fa9c78e7f31a08 /tests/typ | |
| parent | e8e797c18b43559d3dad23452dc48b60d8097729 (diff) | |
Implement CSV file header rows support. (#2619)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/compute/data.typ | 13 |
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) |
