diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-04-13 10:39:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-13 08:39:45 +0000 |
| commit | 020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch) | |
| tree | c0027ad22046e2726c22298461327823d6b88d53 /tests/suite/loading/toml.typ | |
| parent | 72dd79210602ecc799726fc096b078afbb47f299 (diff) | |
Better test runner (#3922)
Diffstat (limited to 'tests/suite/loading/toml.typ')
| -rw-r--r-- | tests/suite/loading/toml.typ | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/suite/loading/toml.typ b/tests/suite/loading/toml.typ new file mode 100644 index 00000000..855ca995 --- /dev/null +++ b/tests/suite/loading/toml.typ @@ -0,0 +1,41 @@ +--- toml --- +// Test reading TOML data. +#let data = toml("/assets/data/toml-types.toml") +#test(data.string, "wonderful") +#test(data.integer, 42) +#test(data.float, 3.14) +#test(data.boolean, true) +#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)) +#test(data.date_time, datetime( + year: 2023, + month: 2, + day: 1, + hour: 15, + minute: 38, + second: 57, +)) +#test(data.date_time2, datetime( + year: 2023, + month: 2, + day: 1, + hour: 15, + minute: 38, + second: 57, +)) +#test(data.date, datetime( + year: 2023, + month: 2, + day: 1, +)) +#test(data.time, datetime( + hour: 15, + minute: 38, + second: 57, +)) + +--- toml-invalid --- +// Error: 7-30 failed to parse TOML (expected `.`, `=` at line 1 column 16) +#toml("/assets/data/bad.toml") |
