summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHarmoGlace <23212967+HarmoGlace@users.noreply.github.com>2023-04-26 11:31:32 +0200
committerGitHub <noreply@github.com>2023-04-26 11:31:32 +0200
commit6134e3f4ee5298153c36d344df97f36279931c33 (patch)
treec4787313543521f079a23e3b6aeb7a4d2a5d0945 /tests
parent7cb63d1aae349541aabc165d8c9e5c0943e38511 (diff)
Add toml support (#807)
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/compute/data.typ17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/typ/compute/data.typ b/tests/typ/compute/data.typ
index cfd761df..8b50f7c4 100644
--- a/tests/typ/compute/data.typ
+++ b/tests/typ/compute/data.typ
@@ -42,6 +42,23 @@
#json("/bad.json")
---
+// Test reading TOML data.
+#let data = toml("/toml_types.toml")
+#test(data.string, "wonderful")
+#test(data.integer, 42)
+#test(data.float, 3.14)
+#test(data.boolean, true)
+#test(data.date_time, "2023-02-01T15:38:57Z")
+#test(data.array, (1, "string", 3.0, false))
+#test(data.inline_table, ("first": "amazing", "second": "greater") )
+#test(data.table.element, 5)
+#test(data.table.others, (false, "indeed", 7))
+
+---
+// Error: 7-18 failed to parse toml file: expected `.`, `=`, index 15-15
+#toml("/bad.toml")
+
+---
// Test reading YAML data
#let data = yaml("/yamltypes.yaml")
#test(data.len(), 7)