diff options
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/utility/data.typ (renamed from tests/typ/utility/csv.typ) | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/typ/utility/csv.typ b/tests/typ/utility/data.typ index 146cafae..4fdb84c2 100644 --- a/tests/typ/utility/csv.typ +++ b/tests/typ/utility/data.typ @@ -1,6 +1,9 @@ -// Test reading structured CSV data. +// Test reading structured data. +// Ref: false --- +// Test reading CSV data. +// Ref: true #set page(width: auto) #let data = csv("/res/zoo.csv") #let cells = data(0).map(strong) + data.slice(1).flatten() @@ -13,3 +16,14 @@ --- // Error: 6-20 failed to parse csv file: found 3 instead of 2 fields in line 3 #csv("/res/bad.csv") + +--- +// Test reading JSON data. +#let data = json("/res/zoo.json") +#test(data.len(), 3) +#test(data(0).name, "Debby") +#test(data(2).weight, 150) + +--- +// Error: 7-22 failed to parse json file: syntax error in line 3 +#json("/res/bad.json") |
