From 7bbbfd046324363c8db1fb15d39aeb02fe7331b5 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 21 Mar 2021 14:10:24 -0600 Subject: hilarious and original joke --- test-suite/tests/backcompat.rs | 14 +- test-suite/tests/datetime.rs | 14 +- test-suite/tests/de-errors.rs | 12 +- test-suite/tests/display-tricky.rs | 12 +- test-suite/tests/display.rs | 6 +- test-suite/tests/float.rs | 10 +- test-suite/tests/formatting.rs | 4 +- test-suite/tests/invalid-misc.rs | 6 +- test-suite/tests/invalid.rs | 94 ++++---- .../tests/invalid/datetime-malformed-no-leads.milf | 1 + .../tests/invalid/datetime-malformed-no-leads.toml | 1 - .../tests/invalid/datetime-malformed-no-secs.milf | 1 + .../tests/invalid/datetime-malformed-no-secs.toml | 1 - .../tests/invalid/datetime-malformed-no-t.milf | 1 + .../tests/invalid/datetime-malformed-no-t.toml | 1 - .../invalid/datetime-malformed-with-milli.milf | 1 + .../invalid/datetime-malformed-with-milli.toml | 1 - test-suite/tests/invalid/duplicate-key-table.milf | 5 + test-suite/tests/invalid/duplicate-key-table.toml | 5 - test-suite/tests/invalid/duplicate-keys.milf | 2 + test-suite/tests/invalid/duplicate-keys.toml | 2 - test-suite/tests/invalid/duplicate-table.milf | 8 + test-suite/tests/invalid/duplicate-table.toml | 8 - test-suite/tests/invalid/duplicate-tables.milf | 2 + test-suite/tests/invalid/duplicate-tables.toml | 2 - test-suite/tests/invalid/empty-implicit-table.milf | 1 + test-suite/tests/invalid/empty-implicit-table.toml | 1 - test-suite/tests/invalid/empty-table.milf | 1 + test-suite/tests/invalid/empty-table.toml | 1 - .../tests/invalid/float-no-leading-zero.milf | 2 + .../tests/invalid/float-no-leading-zero.toml | 2 - test-suite/tests/invalid/float-no-suffix.milf | 1 + test-suite/tests/invalid/float-no-suffix.toml | 1 - .../tests/invalid/float-no-trailing-digits.milf | 2 + .../tests/invalid/float-no-trailing-digits.toml | 2 - test-suite/tests/invalid/key-after-array.milf | 1 + test-suite/tests/invalid/key-after-array.toml | 1 - test-suite/tests/invalid/key-after-table.milf | 1 + test-suite/tests/invalid/key-after-table.toml | 1 - test-suite/tests/invalid/key-empty.milf | 1 + test-suite/tests/invalid/key-empty.toml | 1 - test-suite/tests/invalid/key-hash.milf | 1 + test-suite/tests/invalid/key-hash.toml | 1 - test-suite/tests/invalid/key-newline.milf | 2 + test-suite/tests/invalid/key-newline.toml | 2 - test-suite/tests/invalid/key-open-bracket.milf | 1 + test-suite/tests/invalid/key-open-bracket.toml | 1 - .../tests/invalid/key-single-open-bracket.milf | 1 + .../tests/invalid/key-single-open-bracket.toml | 1 - test-suite/tests/invalid/key-space.milf | 1 + test-suite/tests/invalid/key-space.toml | 1 - test-suite/tests/invalid/key-start-bracket.milf | 3 + test-suite/tests/invalid/key-start-bracket.toml | 3 - test-suite/tests/invalid/key-two-equals.milf | 1 + test-suite/tests/invalid/key-two-equals.toml | 1 - .../tests/invalid/string-bad-byte-escape.milf | 1 + .../tests/invalid/string-bad-byte-escape.toml | 1 - test-suite/tests/invalid/string-bad-escape.milf | 1 + test-suite/tests/invalid/string-bad-escape.toml | 1 - .../invalid/string-bad-line-ending-escape.milf | 3 + .../invalid/string-bad-line-ending-escape.toml | 3 - test-suite/tests/invalid/string-byte-escapes.milf | 1 + test-suite/tests/invalid/string-byte-escapes.toml | 1 - test-suite/tests/invalid/string-no-close.milf | 1 + test-suite/tests/invalid/string-no-close.toml | 1 - test-suite/tests/invalid/table-array-implicit.milf | 14 ++ test-suite/tests/invalid/table-array-implicit.toml | 14 -- .../invalid/table-array-malformed-bracket.milf | 2 + .../invalid/table-array-malformed-bracket.toml | 2 - .../tests/invalid/table-array-malformed-empty.milf | 2 + .../tests/invalid/table-array-malformed-empty.toml | 2 - test-suite/tests/invalid/table-empty.milf | 1 + test-suite/tests/invalid/table-empty.toml | 1 - .../tests/invalid/table-nested-brackets-close.milf | 2 + .../tests/invalid/table-nested-brackets-close.toml | 2 - .../tests/invalid/table-nested-brackets-open.milf | 2 + .../tests/invalid/table-nested-brackets-open.toml | 2 - test-suite/tests/invalid/table-whitespace.milf | 1 + test-suite/tests/invalid/table-whitespace.toml | 1 - test-suite/tests/invalid/table-with-pound.milf | 2 + test-suite/tests/invalid/table-with-pound.toml | 2 - .../tests/invalid/text-after-array-entries.milf | 4 + .../tests/invalid/text-after-array-entries.toml | 4 - test-suite/tests/invalid/text-after-integer.milf | 1 + test-suite/tests/invalid/text-after-integer.toml | 1 - test-suite/tests/invalid/text-after-string.milf | 1 + test-suite/tests/invalid/text-after-string.toml | 1 - test-suite/tests/invalid/text-after-table.milf | 1 + test-suite/tests/invalid/text-after-table.toml | 1 - .../tests/invalid/text-before-array-separator.milf | 4 + .../tests/invalid/text-before-array-separator.toml | 4 - test-suite/tests/invalid/text-in-array.milf | 5 + test-suite/tests/invalid/text-in-array.toml | 5 - test-suite/tests/macros.rs | 38 ++-- test-suite/tests/parser.rs | 22 +- test-suite/tests/pretty.rs | 104 ++++----- test-suite/tests/serde.rs | 64 +++--- test-suite/tests/spanned-impls.rs | 2 +- test-suite/tests/spanned.rs | 22 +- test-suite/tests/tables-last.rs | 6 +- test-suite/tests/valid.rs | 196 ++++++++--------- test-suite/tests/valid/array-empty.milf | 1 + test-suite/tests/valid/array-empty.toml | 1 - .../valid/array-mixed-types-arrays-and-ints.milf | 1 + .../valid/array-mixed-types-arrays-and-ints.toml | 1 - .../valid/array-mixed-types-ints-and-floats.milf | 1 + .../valid/array-mixed-types-ints-and-floats.toml | 1 - .../valid/array-mixed-types-strings-and-ints.milf | 1 + .../valid/array-mixed-types-strings-and-ints.toml | 1 - test-suite/tests/valid/array-nospaces.milf | 1 + test-suite/tests/valid/array-nospaces.toml | 1 - test-suite/tests/valid/arrays-hetergeneous.milf | 1 + test-suite/tests/valid/arrays-hetergeneous.toml | 1 - test-suite/tests/valid/arrays-nested.milf | 1 + test-suite/tests/valid/arrays-nested.toml | 1 - test-suite/tests/valid/arrays.milf | 8 + test-suite/tests/valid/arrays.toml | 8 - test-suite/tests/valid/bool.milf | 2 + test-suite/tests/valid/bool.toml | 2 - test-suite/tests/valid/comments-everywhere.milf | 24 +++ test-suite/tests/valid/comments-everywhere.toml | 24 --- test-suite/tests/valid/datetime-truncate.milf | 1 + test-suite/tests/valid/datetime-truncate.toml | 1 - test-suite/tests/valid/datetime.milf | 1 + test-suite/tests/valid/datetime.toml | 1 - test-suite/tests/valid/dotted-keys.milf | 7 + test-suite/tests/valid/dotted-keys.toml | 7 - test-suite/tests/valid/empty.milf | 0 test-suite/tests/valid/empty.toml | 0 test-suite/tests/valid/example-bom.milf | 5 + test-suite/tests/valid/example-bom.toml | 5 - test-suite/tests/valid/example-v0.3.0.milf | 182 ++++++++++++++++ test-suite/tests/valid/example-v0.3.0.toml | 182 ---------------- test-suite/tests/valid/example-v0.4.0.milf | 236 +++++++++++++++++++++ test-suite/tests/valid/example-v0.4.0.toml | 236 --------------------- test-suite/tests/valid/example.milf | 5 + test-suite/tests/valid/example.toml | 5 - test-suite/tests/valid/example2.json | 2 +- test-suite/tests/valid/example2.milf | 47 ++++ test-suite/tests/valid/example2.toml | 47 ---- test-suite/tests/valid/float-exponent.milf | 9 + test-suite/tests/valid/float-exponent.toml | 9 - test-suite/tests/valid/float.milf | 2 + test-suite/tests/valid/float.toml | 2 - test-suite/tests/valid/hard_example.milf | 33 +++ test-suite/tests/valid/hard_example.toml | 33 --- .../tests/valid/implicit-and-explicit-after.milf | 5 + .../tests/valid/implicit-and-explicit-after.toml | 5 - .../tests/valid/implicit-and-explicit-before.milf | 5 + .../tests/valid/implicit-and-explicit-before.toml | 5 - test-suite/tests/valid/implicit-groups.milf | 2 + test-suite/tests/valid/implicit-groups.toml | 2 - test-suite/tests/valid/integer.milf | 18 ++ test-suite/tests/valid/integer.toml | 18 -- test-suite/tests/valid/key-equals-nospace.milf | 1 + test-suite/tests/valid/key-equals-nospace.toml | 1 - test-suite/tests/valid/key-quote-newline.milf | 1 + test-suite/tests/valid/key-quote-newline.toml | 1 - test-suite/tests/valid/key-space.milf | 1 + test-suite/tests/valid/key-space.toml | 1 - test-suite/tests/valid/key-special-chars.milf | 1 + test-suite/tests/valid/key-special-chars.toml | 1 - test-suite/tests/valid/key-with-pound.milf | 1 + test-suite/tests/valid/key-with-pound.toml | 1 - test-suite/tests/valid/long-float.milf | 2 + test-suite/tests/valid/long-float.toml | 2 - test-suite/tests/valid/long-integer.milf | 2 + test-suite/tests/valid/long-integer.toml | 2 - test-suite/tests/valid/multiline-string.milf | 34 +++ test-suite/tests/valid/multiline-string.toml | 34 --- test-suite/tests/valid/quote-surrounded-value.milf | 2 + test-suite/tests/valid/quote-surrounded-value.toml | 2 - test-suite/tests/valid/raw-multiline-string.milf | 9 + test-suite/tests/valid/raw-multiline-string.toml | 9 - test-suite/tests/valid/raw-string.milf | 7 + test-suite/tests/valid/raw-string.toml | 7 - test-suite/tests/valid/string-delim-end.milf | 3 + test-suite/tests/valid/string-delim-end.toml | 3 - test-suite/tests/valid/string-empty.milf | 1 + test-suite/tests/valid/string-empty.toml | 1 - test-suite/tests/valid/string-escapes.milf | 14 ++ test-suite/tests/valid/string-escapes.toml | 14 -- test-suite/tests/valid/string-simple.milf | 1 + test-suite/tests/valid/string-simple.toml | 1 - test-suite/tests/valid/string-with-pound.milf | 2 + test-suite/tests/valid/string-with-pound.toml | 2 - test-suite/tests/valid/table-array-implicit.milf | 2 + test-suite/tests/valid/table-array-implicit.toml | 2 - test-suite/tests/valid/table-array-many.milf | 11 + test-suite/tests/valid/table-array-many.toml | 11 - .../tests/valid/table-array-nest-no-keys.milf | 6 + .../tests/valid/table-array-nest-no-keys.toml | 6 - test-suite/tests/valid/table-array-nest.milf | 17 ++ test-suite/tests/valid/table-array-nest.toml | 17 -- test-suite/tests/valid/table-array-one.milf | 3 + test-suite/tests/valid/table-array-one.toml | 3 - test-suite/tests/valid/table-empty.milf | 1 + test-suite/tests/valid/table-empty.toml | 1 - test-suite/tests/valid/table-multi-empty.milf | 5 + test-suite/tests/valid/table-multi-empty.toml | 5 - test-suite/tests/valid/table-sub-empty.milf | 2 + test-suite/tests/valid/table-sub-empty.toml | 2 - test-suite/tests/valid/table-whitespace.milf | 1 + test-suite/tests/valid/table-whitespace.toml | 1 - test-suite/tests/valid/table-with-pound.milf | 2 + test-suite/tests/valid/table-with-pound.toml | 2 - test-suite/tests/valid/unicode-escape.milf | 6 + test-suite/tests/valid/unicode-escape.toml | 6 - test-suite/tests/valid/unicode-literal.milf | 1 + test-suite/tests/valid/unicode-literal.toml | 1 - 210 files changed, 1142 insertions(+), 1142 deletions(-) create mode 100644 test-suite/tests/invalid/datetime-malformed-no-leads.milf delete mode 100644 test-suite/tests/invalid/datetime-malformed-no-leads.toml create mode 100644 test-suite/tests/invalid/datetime-malformed-no-secs.milf delete mode 100644 test-suite/tests/invalid/datetime-malformed-no-secs.toml create mode 100644 test-suite/tests/invalid/datetime-malformed-no-t.milf delete mode 100644 test-suite/tests/invalid/datetime-malformed-no-t.toml create mode 100644 test-suite/tests/invalid/datetime-malformed-with-milli.milf delete mode 100644 test-suite/tests/invalid/datetime-malformed-with-milli.toml create mode 100644 test-suite/tests/invalid/duplicate-key-table.milf delete mode 100644 test-suite/tests/invalid/duplicate-key-table.toml create mode 100644 test-suite/tests/invalid/duplicate-keys.milf delete mode 100644 test-suite/tests/invalid/duplicate-keys.toml create mode 100644 test-suite/tests/invalid/duplicate-table.milf delete mode 100644 test-suite/tests/invalid/duplicate-table.toml create mode 100644 test-suite/tests/invalid/duplicate-tables.milf delete mode 100644 test-suite/tests/invalid/duplicate-tables.toml create mode 100644 test-suite/tests/invalid/empty-implicit-table.milf delete mode 100644 test-suite/tests/invalid/empty-implicit-table.toml create mode 100644 test-suite/tests/invalid/empty-table.milf delete mode 100644 test-suite/tests/invalid/empty-table.toml create mode 100644 test-suite/tests/invalid/float-no-leading-zero.milf delete mode 100644 test-suite/tests/invalid/float-no-leading-zero.toml create mode 100644 test-suite/tests/invalid/float-no-suffix.milf delete mode 100644 test-suite/tests/invalid/float-no-suffix.toml create mode 100644 test-suite/tests/invalid/float-no-trailing-digits.milf delete mode 100644 test-suite/tests/invalid/float-no-trailing-digits.toml create mode 100644 test-suite/tests/invalid/key-after-array.milf delete mode 100644 test-suite/tests/invalid/key-after-array.toml create mode 100644 test-suite/tests/invalid/key-after-table.milf delete mode 100644 test-suite/tests/invalid/key-after-table.toml create mode 100644 test-suite/tests/invalid/key-empty.milf delete mode 100644 test-suite/tests/invalid/key-empty.toml create mode 100644 test-suite/tests/invalid/key-hash.milf delete mode 100644 test-suite/tests/invalid/key-hash.toml create mode 100644 test-suite/tests/invalid/key-newline.milf delete mode 100644 test-suite/tests/invalid/key-newline.toml create mode 100644 test-suite/tests/invalid/key-open-bracket.milf delete mode 100644 test-suite/tests/invalid/key-open-bracket.toml create mode 100644 test-suite/tests/invalid/key-single-open-bracket.milf delete mode 100644 test-suite/tests/invalid/key-single-open-bracket.toml create mode 100644 test-suite/tests/invalid/key-space.milf delete mode 100644 test-suite/tests/invalid/key-space.toml create mode 100644 test-suite/tests/invalid/key-start-bracket.milf delete mode 100644 test-suite/tests/invalid/key-start-bracket.toml create mode 100644 test-suite/tests/invalid/key-two-equals.milf delete mode 100644 test-suite/tests/invalid/key-two-equals.toml create mode 100644 test-suite/tests/invalid/string-bad-byte-escape.milf delete mode 100644 test-suite/tests/invalid/string-bad-byte-escape.toml create mode 100644 test-suite/tests/invalid/string-bad-escape.milf delete mode 100644 test-suite/tests/invalid/string-bad-escape.toml create mode 100644 test-suite/tests/invalid/string-bad-line-ending-escape.milf delete mode 100644 test-suite/tests/invalid/string-bad-line-ending-escape.toml create mode 100644 test-suite/tests/invalid/string-byte-escapes.milf delete mode 100644 test-suite/tests/invalid/string-byte-escapes.toml create mode 100644 test-suite/tests/invalid/string-no-close.milf delete mode 100644 test-suite/tests/invalid/string-no-close.toml create mode 100644 test-suite/tests/invalid/table-array-implicit.milf delete mode 100644 test-suite/tests/invalid/table-array-implicit.toml create mode 100644 test-suite/tests/invalid/table-array-malformed-bracket.milf delete mode 100644 test-suite/tests/invalid/table-array-malformed-bracket.toml create mode 100644 test-suite/tests/invalid/table-array-malformed-empty.milf delete mode 100644 test-suite/tests/invalid/table-array-malformed-empty.toml create mode 100644 test-suite/tests/invalid/table-empty.milf delete mode 100644 test-suite/tests/invalid/table-empty.toml create mode 100644 test-suite/tests/invalid/table-nested-brackets-close.milf delete mode 100644 test-suite/tests/invalid/table-nested-brackets-close.toml create mode 100644 test-suite/tests/invalid/table-nested-brackets-open.milf delete mode 100644 test-suite/tests/invalid/table-nested-brackets-open.toml create mode 100644 test-suite/tests/invalid/table-whitespace.milf delete mode 100644 test-suite/tests/invalid/table-whitespace.toml create mode 100644 test-suite/tests/invalid/table-with-pound.milf delete mode 100644 test-suite/tests/invalid/table-with-pound.toml create mode 100644 test-suite/tests/invalid/text-after-array-entries.milf delete mode 100644 test-suite/tests/invalid/text-after-array-entries.toml create mode 100644 test-suite/tests/invalid/text-after-integer.milf delete mode 100644 test-suite/tests/invalid/text-after-integer.toml create mode 100644 test-suite/tests/invalid/text-after-string.milf delete mode 100644 test-suite/tests/invalid/text-after-string.toml create mode 100644 test-suite/tests/invalid/text-after-table.milf delete mode 100644 test-suite/tests/invalid/text-after-table.toml create mode 100644 test-suite/tests/invalid/text-before-array-separator.milf delete mode 100644 test-suite/tests/invalid/text-before-array-separator.toml create mode 100644 test-suite/tests/invalid/text-in-array.milf delete mode 100644 test-suite/tests/invalid/text-in-array.toml create mode 100644 test-suite/tests/valid/array-empty.milf delete mode 100644 test-suite/tests/valid/array-empty.toml create mode 100644 test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf delete mode 100644 test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml create mode 100644 test-suite/tests/valid/array-mixed-types-ints-and-floats.milf delete mode 100644 test-suite/tests/valid/array-mixed-types-ints-and-floats.toml create mode 100644 test-suite/tests/valid/array-mixed-types-strings-and-ints.milf delete mode 100644 test-suite/tests/valid/array-mixed-types-strings-and-ints.toml create mode 100644 test-suite/tests/valid/array-nospaces.milf delete mode 100644 test-suite/tests/valid/array-nospaces.toml create mode 100644 test-suite/tests/valid/arrays-hetergeneous.milf delete mode 100644 test-suite/tests/valid/arrays-hetergeneous.toml create mode 100644 test-suite/tests/valid/arrays-nested.milf delete mode 100644 test-suite/tests/valid/arrays-nested.toml create mode 100644 test-suite/tests/valid/arrays.milf delete mode 100644 test-suite/tests/valid/arrays.toml create mode 100644 test-suite/tests/valid/bool.milf delete mode 100644 test-suite/tests/valid/bool.toml create mode 100644 test-suite/tests/valid/comments-everywhere.milf delete mode 100644 test-suite/tests/valid/comments-everywhere.toml create mode 100644 test-suite/tests/valid/datetime-truncate.milf delete mode 100644 test-suite/tests/valid/datetime-truncate.toml create mode 100644 test-suite/tests/valid/datetime.milf delete mode 100644 test-suite/tests/valid/datetime.toml create mode 100644 test-suite/tests/valid/dotted-keys.milf delete mode 100644 test-suite/tests/valid/dotted-keys.toml create mode 100644 test-suite/tests/valid/empty.milf delete mode 100644 test-suite/tests/valid/empty.toml create mode 100644 test-suite/tests/valid/example-bom.milf delete mode 100644 test-suite/tests/valid/example-bom.toml create mode 100644 test-suite/tests/valid/example-v0.3.0.milf delete mode 100644 test-suite/tests/valid/example-v0.3.0.toml create mode 100644 test-suite/tests/valid/example-v0.4.0.milf delete mode 100644 test-suite/tests/valid/example-v0.4.0.toml create mode 100644 test-suite/tests/valid/example.milf delete mode 100644 test-suite/tests/valid/example.toml create mode 100644 test-suite/tests/valid/example2.milf delete mode 100644 test-suite/tests/valid/example2.toml create mode 100644 test-suite/tests/valid/float-exponent.milf delete mode 100644 test-suite/tests/valid/float-exponent.toml create mode 100644 test-suite/tests/valid/float.milf delete mode 100644 test-suite/tests/valid/float.toml create mode 100644 test-suite/tests/valid/hard_example.milf delete mode 100644 test-suite/tests/valid/hard_example.toml create mode 100644 test-suite/tests/valid/implicit-and-explicit-after.milf delete mode 100644 test-suite/tests/valid/implicit-and-explicit-after.toml create mode 100644 test-suite/tests/valid/implicit-and-explicit-before.milf delete mode 100644 test-suite/tests/valid/implicit-and-explicit-before.toml create mode 100644 test-suite/tests/valid/implicit-groups.milf delete mode 100644 test-suite/tests/valid/implicit-groups.toml create mode 100644 test-suite/tests/valid/integer.milf delete mode 100644 test-suite/tests/valid/integer.toml create mode 100644 test-suite/tests/valid/key-equals-nospace.milf delete mode 100644 test-suite/tests/valid/key-equals-nospace.toml create mode 100644 test-suite/tests/valid/key-quote-newline.milf delete mode 100644 test-suite/tests/valid/key-quote-newline.toml create mode 100644 test-suite/tests/valid/key-space.milf delete mode 100644 test-suite/tests/valid/key-space.toml create mode 100644 test-suite/tests/valid/key-special-chars.milf delete mode 100644 test-suite/tests/valid/key-special-chars.toml create mode 100644 test-suite/tests/valid/key-with-pound.milf delete mode 100644 test-suite/tests/valid/key-with-pound.toml create mode 100644 test-suite/tests/valid/long-float.milf delete mode 100644 test-suite/tests/valid/long-float.toml create mode 100644 test-suite/tests/valid/long-integer.milf delete mode 100644 test-suite/tests/valid/long-integer.toml create mode 100644 test-suite/tests/valid/multiline-string.milf delete mode 100644 test-suite/tests/valid/multiline-string.toml create mode 100644 test-suite/tests/valid/quote-surrounded-value.milf delete mode 100644 test-suite/tests/valid/quote-surrounded-value.toml create mode 100644 test-suite/tests/valid/raw-multiline-string.milf delete mode 100644 test-suite/tests/valid/raw-multiline-string.toml create mode 100644 test-suite/tests/valid/raw-string.milf delete mode 100644 test-suite/tests/valid/raw-string.toml create mode 100644 test-suite/tests/valid/string-delim-end.milf delete mode 100644 test-suite/tests/valid/string-delim-end.toml create mode 100644 test-suite/tests/valid/string-empty.milf delete mode 100644 test-suite/tests/valid/string-empty.toml create mode 100644 test-suite/tests/valid/string-escapes.milf delete mode 100644 test-suite/tests/valid/string-escapes.toml create mode 100644 test-suite/tests/valid/string-simple.milf delete mode 100644 test-suite/tests/valid/string-simple.toml create mode 100644 test-suite/tests/valid/string-with-pound.milf delete mode 100644 test-suite/tests/valid/string-with-pound.toml create mode 100644 test-suite/tests/valid/table-array-implicit.milf delete mode 100644 test-suite/tests/valid/table-array-implicit.toml create mode 100644 test-suite/tests/valid/table-array-many.milf delete mode 100644 test-suite/tests/valid/table-array-many.toml create mode 100644 test-suite/tests/valid/table-array-nest-no-keys.milf delete mode 100644 test-suite/tests/valid/table-array-nest-no-keys.toml create mode 100644 test-suite/tests/valid/table-array-nest.milf delete mode 100644 test-suite/tests/valid/table-array-nest.toml create mode 100644 test-suite/tests/valid/table-array-one.milf delete mode 100644 test-suite/tests/valid/table-array-one.toml create mode 100644 test-suite/tests/valid/table-empty.milf delete mode 100644 test-suite/tests/valid/table-empty.toml create mode 100644 test-suite/tests/valid/table-multi-empty.milf delete mode 100644 test-suite/tests/valid/table-multi-empty.toml create mode 100644 test-suite/tests/valid/table-sub-empty.milf delete mode 100644 test-suite/tests/valid/table-sub-empty.toml create mode 100644 test-suite/tests/valid/table-whitespace.milf delete mode 100644 test-suite/tests/valid/table-whitespace.toml create mode 100644 test-suite/tests/valid/table-with-pound.milf delete mode 100644 test-suite/tests/valid/table-with-pound.toml create mode 100644 test-suite/tests/valid/unicode-escape.milf delete mode 100644 test-suite/tests/valid/unicode-escape.toml create mode 100644 test-suite/tests/valid/unicode-literal.milf delete mode 100644 test-suite/tests/valid/unicode-literal.toml (limited to 'test-suite/tests') diff --git a/test-suite/tests/backcompat.rs b/test-suite/tests/backcompat.rs index ef3bd36..7d4fcee 100644 --- a/test-suite/tests/backcompat.rs +++ b/test-suite/tests/backcompat.rs @@ -1,11 +1,11 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::de::Deserialize; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::() { + ($milf:expr, $msg:expr) => { + match $milf.parse::() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -23,9 +23,9 @@ fn newlines_after_tables() { "expected newline, found an identifier at line 2 column 13" ); - let mut d = toml::de::Deserializer::new(s); + let mut d = milf::de::Deserializer::new(s); d.set_require_newline_after_table(false); - let value = toml::Value::deserialize(&mut d).unwrap(); + let value = milf::Value::deserialize(&mut d).unwrap(); assert_eq!(value["a"]["foo"].as_integer(), Some(1)); assert_eq!(value["b"][0]["foo"].as_integer(), Some(1)); } @@ -47,9 +47,9 @@ fn allow_duplicate_after_longer() { "redefinition of table `dependencies` for key `dependencies` at line 8 column 9" ); - let mut d = toml::de::Deserializer::new(s); + let mut d = milf::de::Deserializer::new(s); d.set_allow_duplicate_after_longer_table(true); - let value = toml::Value::deserialize(&mut d).unwrap(); + let value = milf::Value::deserialize(&mut d).unwrap(); assert_eq!( value["dependencies"]["openssl-sys"]["version"].as_integer(), Some(1) diff --git a/test-suite/tests/datetime.rs b/test-suite/tests/datetime.rs index 6c08748..729591e 100644 --- a/test-suite/tests/datetime.rs +++ b/test-suite/tests/datetime.rs @@ -1,10 +1,10 @@ -extern crate toml; +extern crate milf; use std::str::FromStr; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::() { + ($milf:expr, $msg:expr) => { + match $milf.parse::() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -15,7 +15,7 @@ macro_rules! bad { fn times() { fn dogood(s: &str, serialized: &str) { let to_parse = format!("foo = {}", s); - let value = toml::Value::from_str(&to_parse).unwrap(); + let value = milf::Value::from_str(&to_parse).unwrap(); assert_eq!(value["foo"].as_datetime().unwrap().to_string(), serialized); } fn good(s: &str) { @@ -68,15 +68,15 @@ fn bad_times() { ); bad!( "foo = T", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = T.", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = TZ", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = 1997-09-09T09:09:09.09+", diff --git a/test-suite/tests/de-errors.rs b/test-suite/tests/de-errors.rs index 7666489..656dd49 100644 --- a/test-suite/tests/de-errors.rs +++ b/test-suite/tests/de-errors.rs @@ -1,12 +1,12 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::{de, Deserialize}; use std::fmt; macro_rules! bad { - ($toml:expr, $ty:ty, $msg:expr) => { - match toml::from_str::<$ty>($toml) { + ($milf:expr, $ty:ty, $msg:expr) => { + match milf::from_str::<$ty>($milf) { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -71,7 +71,7 @@ impl<'de> de::Deserialize<'de> for CasedString { #[test] fn custom_errors() { - toml::from_str::>( + milf::from_str::>( " p_a = 'a' p_b = [{c_a = 'a', c_b = 'c'}] @@ -333,7 +333,7 @@ fn error_handles_crlf() { a = 1\r\n\ a = 2\r\n\ ", - toml::Value, + milf::Value, "duplicate key: `a` for key `t2` at line 3 column 1" ); @@ -345,7 +345,7 @@ fn error_handles_crlf() { a = 1\n\ a = 2\n\ ", - toml::Value, + milf::Value, "duplicate key: `a` for key `t2` at line 3 column 1" ); } diff --git a/test-suite/tests/display-tricky.rs b/test-suite/tests/display-tricky.rs index 0daa10e..631ce70 100644 --- a/test-suite/tests/display-tricky.rs +++ b/test-suite/tests/display-tricky.rs @@ -1,4 +1,4 @@ -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; @@ -26,7 +26,7 @@ pub struct Packages { #[test] fn both_ends() { - let recipe_works = toml::from_str::( + let recipe_works = milf::from_str::( r#" name = "testing" description = "example" @@ -37,9 +37,9 @@ fn both_ends() { "#, ) .unwrap(); - toml::to_string(&recipe_works).unwrap(); + milf::to_string(&recipe_works).unwrap(); - let recipe_fails = toml::from_str::( + let recipe_fails = milf::from_str::( r#" name = "testing" description = "example" @@ -51,6 +51,6 @@ fn both_ends() { ) .unwrap(); - let recipe_toml = toml::Value::try_from(recipe_fails).unwrap(); - recipe_toml.to_string(); + let recipe_milf = milf::Value::try_from(recipe_fails).unwrap(); + recipe_milf.to_string(); } diff --git a/test-suite/tests/display.rs b/test-suite/tests/display.rs index 5d9f44a..73067e6 100644 --- a/test-suite/tests/display.rs +++ b/test-suite/tests/display.rs @@ -1,7 +1,7 @@ -extern crate toml; +extern crate milf; -use toml::map::Map; -use toml::Value::{Array, Boolean, Float, Integer, String, Table}; +use milf::map::Map; +use milf::Value::{Array, Boolean, Float, Integer, String, Table}; macro_rules! map( ($($k:expr => $v:expr),*) => ({ let mut _m = Map::new(); diff --git a/test-suite/tests/float.rs b/test-suite/tests/float.rs index 66414ea..0b639dc 100644 --- a/test-suite/tests/float.rs +++ b/test-suite/tests/float.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; -use toml::Value; +use milf::Value; #[rustfmt::skip] // appears to be a bug in rustfmt to make this converge... macro_rules! float_inf_tests { @@ -18,7 +18,7 @@ macro_rules! float_inf_tests { sf7: $ty, sf8: $ty, } - let inf: S = toml::from_str( + let inf: S = milf::from_str( r" # infinity sf1 = inf # positive infinity @@ -56,7 +56,7 @@ macro_rules! float_inf_tests { assert_eq!(inf.sf8, 0.0); assert!(inf.sf8.is_sign_negative()); - let s = toml::to_string(&inf).unwrap(); + let s = milf::to_string(&inf).unwrap(); assert_eq!( s, "\ @@ -71,7 +71,7 @@ sf8 = -0.0 " ); - toml::from_str::(&s).expect("roundtrip"); + milf::from_str::(&s).expect("roundtrip"); }}; } diff --git a/test-suite/tests/formatting.rs b/test-suite/tests/formatting.rs index 8e15ec2..b459d5f 100644 --- a/test-suite/tests/formatting.rs +++ b/test-suite/tests/formatting.rs @@ -1,8 +1,8 @@ #[macro_use] extern crate serde_derive; -extern crate toml; +extern crate milf; -use toml::to_string; +use milf::to_string; #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)] struct User { diff --git a/test-suite/tests/invalid-misc.rs b/test-suite/tests/invalid-misc.rs index cea0801..14fc6c3 100644 --- a/test-suite/tests/invalid-misc.rs +++ b/test-suite/tests/invalid-misc.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::() { + ($milf:expr, $msg:expr) => { + match $milf.parse::() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } diff --git a/test-suite/tests/invalid.rs b/test-suite/tests/invalid.rs index f04d860..119e748 100644 --- a/test-suite/tests/invalid.rs +++ b/test-suite/tests/invalid.rs @@ -1,8 +1,8 @@ -extern crate toml; +extern crate milf; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::() { + ($milf:expr, $msg:expr) => { + match $milf.parse::() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -16,211 +16,211 @@ macro_rules! test( ($name:ident, $s:expr, $msg:expr) => ( test!( datetime_malformed_no_leads, - include_str!("invalid/datetime-malformed-no-leads.toml"), + include_str!("invalid/datetime-malformed-no-leads.milf"), "failed to parse datetime for key `no-leads` at line 1 column 12" ); test!( datetime_malformed_no_secs, - include_str!("invalid/datetime-malformed-no-secs.toml"), + include_str!("invalid/datetime-malformed-no-secs.milf"), "expected a colon, found a newline at line 1 column 28" ); test!( datetime_malformed_no_t, - include_str!("invalid/datetime-malformed-no-t.toml"), + include_str!("invalid/datetime-malformed-no-t.milf"), "failed to parse datetime for key `no-t` at line 1 column 8" ); test!( datetime_malformed_with_milli, - include_str!("invalid/datetime-malformed-with-milli.toml"), + include_str!("invalid/datetime-malformed-with-milli.milf"), "failed to parse datetime for key `with-milli` at line 1 column 14" ); test!( duplicate_key_table, - include_str!("invalid/duplicate-key-table.toml"), + include_str!("invalid/duplicate-key-table.milf"), "duplicate key: `type` for key `fruit` at line 4 column 1" ); test!( duplicate_keys, - include_str!("invalid/duplicate-keys.toml"), + include_str!("invalid/duplicate-keys.milf"), "duplicate key: `dupe` at line 1 column 1" ); test!( duplicate_table, - include_str!("invalid/duplicate-table.toml"), + include_str!("invalid/duplicate-table.milf"), "redefinition of table `dependencies` for key `dependencies` at line 7 column 1" ); test!( duplicate_tables, - include_str!("invalid/duplicate-tables.toml"), + include_str!("invalid/duplicate-tables.milf"), "redefinition of table `a` for key `a` at line 2 column 1" ); test!( empty_implicit_table, - include_str!("invalid/empty-implicit-table.toml"), + include_str!("invalid/empty-implicit-table.milf"), "expected a table key, found a period at line 1 column 10" ); test!( empty_table, - include_str!("invalid/empty-table.toml"), + include_str!("invalid/empty-table.milf"), "expected a table key, found a right bracket at line 1 column 2" ); test!( float_no_leading_zero, - include_str!("invalid/float-no-leading-zero.toml"), + include_str!("invalid/float-no-leading-zero.milf"), "expected a value, found a period at line 1 column 10" ); test!( float_no_suffix, - include_str!("invalid/float-no-suffix.toml"), + include_str!("invalid/float-no-suffix.milf"), "invalid number at line 1 column 5" ); test!( float_no_trailing_digits, - include_str!("invalid/float-no-trailing-digits.toml"), + include_str!("invalid/float-no-trailing-digits.milf"), "invalid number at line 1 column 12" ); test!( key_after_array, - include_str!("invalid/key-after-array.toml"), + include_str!("invalid/key-after-array.milf"), "expected newline, found an identifier at line 1 column 14" ); test!( key_after_table, - include_str!("invalid/key-after-table.toml"), + include_str!("invalid/key-after-table.milf"), "expected newline, found an identifier at line 1 column 11" ); test!( key_empty, - include_str!("invalid/key-empty.toml"), + include_str!("invalid/key-empty.milf"), "expected a table key, found an equals at line 1 column 2" ); test!( key_hash, - include_str!("invalid/key-hash.toml"), + include_str!("invalid/key-hash.milf"), "expected an equals, found a comment at line 1 column 2" ); test!( key_newline, - include_str!("invalid/key-newline.toml"), + include_str!("invalid/key-newline.milf"), "expected an equals, found a newline at line 1 column 2" ); test!( key_open_bracket, - include_str!("invalid/key-open-bracket.toml"), + include_str!("invalid/key-open-bracket.milf"), "expected a right bracket, found an equals at line 1 column 6" ); test!( key_single_open_bracket, - include_str!("invalid/key-single-open-bracket.toml"), + include_str!("invalid/key-single-open-bracket.milf"), "expected a table key, found eof at line 1 column 2" ); test!( key_space, - include_str!("invalid/key-space.toml"), + include_str!("invalid/key-space.milf"), "expected an equals, found an identifier at line 1 column 3" ); test!( key_start_bracket, - include_str!("invalid/key-start-bracket.toml"), + include_str!("invalid/key-start-bracket.milf"), "expected a right bracket, found an equals at line 2 column 6" ); test!( key_two_equals, - include_str!("invalid/key-two-equals.toml"), + include_str!("invalid/key-two-equals.milf"), "expected a value, found an equals at line 1 column 6" ); test!( string_bad_byte_escape, - include_str!("invalid/string-bad-byte-escape.toml"), + include_str!("invalid/string-bad-byte-escape.milf"), "invalid escape character in string: `x` at line 1 column 13" ); test!( string_bad_escape, - include_str!("invalid/string-bad-escape.toml"), + include_str!("invalid/string-bad-escape.milf"), "invalid escape character in string: `a` at line 1 column 42" ); test!( string_bad_line_ending_escape, - include_str!("invalid/string-bad-line-ending-escape.toml"), + include_str!("invalid/string-bad-line-ending-escape.milf"), "invalid escape character in string: ` ` at line 2 column 79" ); test!( string_byte_escapes, - include_str!("invalid/string-byte-escapes.toml"), + include_str!("invalid/string-byte-escapes.milf"), "invalid escape character in string: `x` at line 1 column 12" ); test!( string_no_close, - include_str!("invalid/string-no-close.toml"), + include_str!("invalid/string-no-close.milf"), "newline in string found at line 1 column 42" ); test!( table_array_implicit, - include_str!("invalid/table-array-implicit.toml"), + include_str!("invalid/table-array-implicit.milf"), "table redefined as array for key `albums` at line 13 column 1" ); test!( table_array_malformed_bracket, - include_str!("invalid/table-array-malformed-bracket.toml"), + include_str!("invalid/table-array-malformed-bracket.milf"), "expected a right bracket, found a newline at line 1 column 10" ); test!( table_array_malformed_empty, - include_str!("invalid/table-array-malformed-empty.toml"), + include_str!("invalid/table-array-malformed-empty.milf"), "expected a table key, found a right bracket at line 1 column 3" ); test!( table_empty, - include_str!("invalid/table-empty.toml"), + include_str!("invalid/table-empty.milf"), "expected a table key, found a right bracket at line 1 column 2" ); test!( table_nested_brackets_close, - include_str!("invalid/table-nested-brackets-close.toml"), + include_str!("invalid/table-nested-brackets-close.milf"), "expected newline, found an identifier at line 1 column 4" ); test!( table_nested_brackets_open, - include_str!("invalid/table-nested-brackets-open.toml"), + include_str!("invalid/table-nested-brackets-open.milf"), "expected a right bracket, found a left bracket at line 1 column 3" ); test!( table_whitespace, - include_str!("invalid/table-whitespace.toml"), + include_str!("invalid/table-whitespace.milf"), "expected a right bracket, found an identifier at line 1 column 10" ); test!( table_with_pound, - include_str!("invalid/table-with-pound.toml"), + include_str!("invalid/table-with-pound.milf"), "expected a right bracket, found a comment at line 1 column 5" ); test!( text_after_array_entries, - include_str!("invalid/text-after-array-entries.toml"), - "invalid TOML value, did you mean to use a quoted string? at line 2 column 46" + include_str!("invalid/text-after-array-entries.milf"), + "invalid MILF value, did you mean to use a quoted string? at line 2 column 46" ); test!( text_after_integer, - include_str!("invalid/text-after-integer.toml"), + include_str!("invalid/text-after-integer.milf"), "expected newline, found an identifier at line 1 column 13" ); test!( text_after_string, - include_str!("invalid/text-after-string.toml"), + include_str!("invalid/text-after-string.milf"), "expected newline, found an identifier at line 1 column 41" ); test!( text_after_table, - include_str!("invalid/text-after-table.toml"), + include_str!("invalid/text-after-table.milf"), "expected newline, found an identifier at line 1 column 9" ); test!( text_before_array_separator, - include_str!("invalid/text-before-array-separator.toml"), + include_str!("invalid/text-before-array-separator.milf"), "expected a right bracket, found an identifier at line 2 column 46" ); test!( text_in_array, - include_str!("invalid/text-in-array.toml"), - "invalid TOML value, did you mean to use a quoted string? at line 3 column 3" + include_str!("invalid/text-in-array.milf"), + "invalid MILF value, did you mean to use a quoted string? at line 3 column 3" ); diff --git a/test-suite/tests/invalid/datetime-malformed-no-leads.milf b/test-suite/tests/invalid/datetime-malformed-no-leads.milf new file mode 100644 index 0000000..123f173 --- /dev/null +++ b/test-suite/tests/invalid/datetime-malformed-no-leads.milf @@ -0,0 +1 @@ +no-leads = 1987-7-05T17:45:00Z diff --git a/test-suite/tests/invalid/datetime-malformed-no-leads.toml b/test-suite/tests/invalid/datetime-malformed-no-leads.toml deleted file mode 100644 index 123f173..0000000 --- a/test-suite/tests/invalid/datetime-malformed-no-leads.toml +++ /dev/null @@ -1 +0,0 @@ -no-leads = 1987-7-05T17:45:00Z diff --git a/test-suite/tests/invalid/datetime-malformed-no-secs.milf b/test-suite/tests/invalid/datetime-malformed-no-secs.milf new file mode 100644 index 0000000..ba93900 --- /dev/null +++ b/test-suite/tests/invalid/datetime-malformed-no-secs.milf @@ -0,0 +1 @@ +no-secs = 1987-07-05T17:45Z diff --git a/test-suite/tests/invalid/datetime-malformed-no-secs.toml b/test-suite/tests/invalid/datetime-malformed-no-secs.toml deleted file mode 100644 index ba93900..0000000 --- a/test-suite/tests/invalid/datetime-malformed-no-secs.toml +++ /dev/null @@ -1 +0,0 @@ -no-secs = 1987-07-05T17:45Z diff --git a/test-suite/tests/invalid/datetime-malformed-no-t.milf b/test-suite/tests/invalid/datetime-malformed-no-t.milf new file mode 100644 index 0000000..617e3c5 --- /dev/null +++ b/test-suite/tests/invalid/datetime-malformed-no-t.milf @@ -0,0 +1 @@ +no-t = 1987-07-0517:45:00Z diff --git a/test-suite/tests/invalid/datetime-malformed-no-t.toml b/test-suite/tests/invalid/datetime-malformed-no-t.toml deleted file mode 100644 index 617e3c5..0000000 --- a/test-suite/tests/invalid/datetime-malformed-no-t.toml +++ /dev/null @@ -1 +0,0 @@ -no-t = 1987-07-0517:45:00Z diff --git a/test-suite/tests/invalid/datetime-malformed-with-milli.milf b/test-suite/tests/invalid/datetime-malformed-with-milli.milf new file mode 100644 index 0000000..eef792f --- /dev/null +++ b/test-suite/tests/invalid/datetime-malformed-with-milli.milf @@ -0,0 +1 @@ +with-milli = 1987-07-5T17:45:00.12Z diff --git a/test-suite/tests/invalid/datetime-malformed-with-milli.toml b/test-suite/tests/invalid/datetime-malformed-with-milli.toml deleted file mode 100644 index eef792f..0000000 --- a/test-suite/tests/invalid/datetime-malformed-with-milli.toml +++ /dev/null @@ -1 +0,0 @@ -with-milli = 1987-07-5T17:45:00.12Z diff --git a/test-suite/tests/invalid/duplicate-key-table.milf b/test-suite/tests/invalid/duplicate-key-table.milf new file mode 100644 index 0000000..cedf05f --- /dev/null +++ b/test-suite/tests/invalid/duplicate-key-table.milf @@ -0,0 +1,5 @@ +[fruit] +type = "apple" + +[fruit.type] +apple = "yes" diff --git a/test-suite/tests/invalid/duplicate-key-table.toml b/test-suite/tests/invalid/duplicate-key-table.toml deleted file mode 100644 index cedf05f..0000000 --- a/test-suite/tests/invalid/duplicate-key-table.toml +++ /dev/null @@ -1,5 +0,0 @@ -[fruit] -type = "apple" - -[fruit.type] -apple = "yes" diff --git a/test-suite/tests/invalid/duplicate-keys.milf b/test-suite/tests/invalid/duplicate-keys.milf new file mode 100644 index 0000000..9b5aee0 --- /dev/null +++ b/test-suite/tests/invalid/duplicate-keys.milf @@ -0,0 +1,2 @@ +dupe = false +dupe = true diff --git a/test-suite/tests/invalid/duplicate-keys.toml b/test-suite/tests/invalid/duplicate-keys.toml deleted file mode 100644 index 9b5aee0..0000000 --- a/test-suite/tests/invalid/duplicate-keys.toml +++ /dev/null @@ -1,2 +0,0 @@ -dupe = false -dupe = true diff --git a/test-suite/tests/invalid/duplicate-table.milf b/test-suite/tests/invalid/duplicate-table.milf new file mode 100644 index 0000000..5bd2571 --- /dev/null +++ b/test-suite/tests/invalid/duplicate-table.milf @@ -0,0 +1,8 @@ +[dependencies.openssl-sys] +version = "0.5.2" + +[dependencies] +libc = "0.1" + +[dependencies] +bitflags = "0.1.1" diff --git a/test-suite/tests/invalid/duplicate-table.toml b/test-suite/tests/invalid/duplicate-table.toml deleted file mode 100644 index 5bd2571..0000000 --- a/test-suite/tests/invalid/duplicate-table.toml +++ /dev/null @@ -1,8 +0,0 @@ -[dependencies.openssl-sys] -version = "0.5.2" - -[dependencies] -libc = "0.1" - -[dependencies] -bitflags = "0.1.1" diff --git a/test-suite/tests/invalid/duplicate-tables.milf b/test-suite/tests/invalid/duplicate-tables.milf new file mode 100644 index 0000000..8ddf49b --- /dev/null +++ b/test-suite/tests/invalid/duplicate-tables.milf @@ -0,0 +1,2 @@ +[a] +[a] diff --git a/test-suite/tests/invalid/duplicate-tables.toml b/test-suite/tests/invalid/duplicate-tables.toml deleted file mode 100644 index 8ddf49b..0000000 --- a/test-suite/tests/invalid/duplicate-tables.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a] -[a] diff --git a/test-suite/tests/invalid/empty-implicit-table.milf b/test-suite/tests/invalid/empty-implicit-table.milf new file mode 100644 index 0000000..0cc36d0 --- /dev/null +++ b/test-suite/tests/invalid/empty-implicit-table.milf @@ -0,0 +1 @@ +[naughty..naughty] diff --git a/test-suite/tests/invalid/empty-implicit-table.toml b/test-suite/tests/invalid/empty-implicit-table.toml deleted file mode 100644 index 0cc36d0..0000000 --- a/test-suite/tests/invalid/empty-implicit-table.toml +++ /dev/null @@ -1 +0,0 @@ -[naughty..naughty] diff --git a/test-suite/tests/invalid/empty-table.milf b/test-suite/tests/invalid/empty-table.milf new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test-suite/tests/invalid/empty-table.milf @@ -0,0 +1 @@ +[] diff --git a/test-suite/tests/invalid/empty-table.toml b/test-suite/tests/invalid/empty-table.toml deleted file mode 100644 index fe51488..0000000 --- a/test-suite/tests/invalid/empty-table.toml +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/test-suite/tests/invalid/float-no-leading-zero.milf b/test-suite/tests/invalid/float-no-leading-zero.milf new file mode 100644 index 0000000..cab76bf --- /dev/null +++ b/test-suite/tests/invalid/float-no-leading-zero.milf @@ -0,0 +1,2 @@ +answer = .12345 +neganswer = -.12345 diff --git a/test-suite/tests/invalid/float-no-leading-zero.toml b/test-suite/tests/invalid/float-no-leading-zero.toml deleted file mode 100644 index cab76bf..0000000 --- a/test-suite/tests/invalid/float-no-leading-zero.toml +++ /dev/null @@ -1,2 +0,0 @@ -answer = .12345 -neganswer = -.12345 diff --git a/test-suite/tests/invalid/float-no-suffix.milf b/test-suite/tests/invalid/float-no-suffix.milf new file mode 100644 index 0000000..76106de --- /dev/null +++ b/test-suite/tests/invalid/float-no-suffix.milf @@ -0,0 +1 @@ +a = 1.2f diff --git a/test-suite/tests/invalid/float-no-suffix.toml b/test-suite/tests/invalid/float-no-suffix.toml deleted file mode 100644 index 76106de..0000000 --- a/test-suite/tests/invalid/float-no-suffix.toml +++ /dev/null @@ -1 +0,0 @@ -a = 1.2f diff --git a/test-suite/tests/invalid/float-no-trailing-digits.milf b/test-suite/tests/invalid/float-no-trailing-digits.milf new file mode 100644 index 0000000..cbff2d0 --- /dev/null +++ b/test-suite/tests/invalid/float-no-trailing-digits.milf @@ -0,0 +1,2 @@ +answer = 1. +neganswer = -1. diff --git a/test-suite/tests/invalid/float-no-trailing-digits.toml b/test-suite/tests/invalid/float-no-trailing-digits.toml deleted file mode 100644 index cbff2d0..0000000 --- a/test-suite/tests/invalid/float-no-trailing-digits.toml +++ /dev/null @@ -1,2 +0,0 @@ -answer = 1. -neganswer = -1. diff --git a/test-suite/tests/invalid/key-after-array.milf b/test-suite/tests/invalid/key-after-array.milf new file mode 100644 index 0000000..5c1a1b0 --- /dev/null +++ b/test-suite/tests/invalid/key-after-array.milf @@ -0,0 +1 @@ +[[agencies]] owner = "S Cjelli" diff --git a/test-suite/tests/invalid/key-after-array.toml b/test-suite/tests/invalid/key-after-array.toml deleted file mode 100644 index 5c1a1b0..0000000 --- a/test-suite/tests/invalid/key-after-array.toml +++ /dev/null @@ -1 +0,0 @@ -[[agencies]] owner = "S Cjelli" diff --git a/test-suite/tests/invalid/key-after-table.milf b/test-suite/tests/invalid/key-after-table.milf new file mode 100644 index 0000000..4bc8213 --- /dev/null +++ b/test-suite/tests/invalid/key-after-table.milf @@ -0,0 +1 @@ +[history] guard = "sleeping" diff --git a/test-suite/tests/invalid/key-after-table.toml b/test-suite/tests/invalid/key-after-table.toml deleted file mode 100644 index 4bc8213..0000000 --- a/test-suite/tests/invalid/key-after-table.toml +++ /dev/null @@ -1 +0,0 @@ -[history] guard = "sleeping" diff --git a/test-suite/tests/invalid/key-empty.milf b/test-suite/tests/invalid/key-empty.milf new file mode 100644 index 0000000..09f998f --- /dev/null +++ b/test-suite/tests/invalid/key-empty.milf @@ -0,0 +1 @@ + = 1 diff --git a/test-suite/tests/invalid/key-empty.toml b/test-suite/tests/invalid/key-empty.toml deleted file mode 100644 index 09f998f..0000000 --- a/test-suite/tests/invalid/key-empty.toml +++ /dev/null @@ -1 +0,0 @@ - = 1 diff --git a/test-suite/tests/invalid/key-hash.milf b/test-suite/tests/invalid/key-hash.milf new file mode 100644 index 0000000..e321b1f --- /dev/null +++ b/test-suite/tests/invalid/key-hash.milf @@ -0,0 +1 @@ +a# = 1 diff --git a/test-suite/tests/invalid/key-hash.toml b/test-suite/tests/invalid/key-hash.toml deleted file mode 100644 index e321b1f..0000000 --- a/test-suite/tests/invalid/key-hash.toml +++ /dev/null @@ -1 +0,0 @@ -a# = 1 diff --git a/test-suite/tests/invalid/key-newline.milf b/test-suite/tests/invalid/key-newline.milf new file mode 100644 index 0000000..707aad5 --- /dev/null +++ b/test-suite/tests/invalid/key-newline.milf @@ -0,0 +1,2 @@ +a += 1 diff --git a/test-suite/tests/invalid/key-newline.toml b/test-suite/tests/invalid/key-newline.toml deleted file mode 100644 index 707aad5..0000000 --- a/test-suite/tests/invalid/key-newline.toml +++ /dev/null @@ -1,2 +0,0 @@ -a -= 1 diff --git a/test-suite/tests/invalid/key-open-bracket.milf b/test-suite/tests/invalid/key-open-bracket.milf new file mode 100644 index 0000000..f0aeb16 --- /dev/null +++ b/test-suite/tests/invalid/key-open-bracket.milf @@ -0,0 +1 @@ +[abc = 1 diff --git a/test-suite/tests/invalid/key-open-bracket.toml b/test-suite/tests/invalid/key-open-bracket.toml deleted file mode 100644 index f0aeb16..0000000 --- a/test-suite/tests/invalid/key-open-bracket.toml +++ /dev/null @@ -1 +0,0 @@ -[abc = 1 diff --git a/test-suite/tests/invalid/key-single-open-bracket.milf b/test-suite/tests/invalid/key-single-open-bracket.milf new file mode 100644 index 0000000..8e2f0be --- /dev/null +++ b/test-suite/tests/invalid/key-single-open-bracket.milf @@ -0,0 +1 @@ +[ \ No newline at end of file diff --git a/test-suite/tests/invalid/key-single-open-bracket.toml b/test-suite/tests/invalid/key-single-open-bracket.toml deleted file mode 100644 index 8e2f0be..0000000 --- a/test-suite/tests/invalid/key-single-open-bracket.toml +++ /dev/null @@ -1 +0,0 @@ -[ \ No newline at end of file diff --git a/test-suite/tests/invalid/key-space.milf b/test-suite/tests/invalid/key-space.milf new file mode 100644 index 0000000..201806d --- /dev/null +++ b/test-suite/tests/invalid/key-space.milf @@ -0,0 +1 @@ +a b = 1 \ No newline at end of file diff --git a/test-suite/tests/invalid/key-space.toml b/test-suite/tests/invalid/key-space.toml deleted file mode 100644 index 201806d..0000000 --- a/test-suite/tests/invalid/key-space.toml +++ /dev/null @@ -1 +0,0 @@ -a b = 1 \ No newline at end of file diff --git a/test-suite/tests/invalid/key-start-bracket.milf b/test-suite/tests/invalid/key-start-bracket.milf new file mode 100644 index 0000000..e0597ae --- /dev/null +++ b/test-suite/tests/invalid/key-start-bracket.milf @@ -0,0 +1,3 @@ +[a] +[xyz = 5 +[b] diff --git a/test-suite/tests/invalid/key-start-bracket.toml b/test-suite/tests/invalid/key-start-bracket.toml deleted file mode 100644 index e0597ae..0000000 --- a/test-suite/tests/invalid/key-start-bracket.toml +++ /dev/null @@ -1,3 +0,0 @@ -[a] -[xyz = 5 -[b] diff --git a/test-suite/tests/invalid/key-two-equals.milf b/test-suite/tests/invalid/key-two-equals.milf new file mode 100644 index 0000000..25a0378 --- /dev/null +++ b/test-suite/tests/invalid/key-two-equals.milf @@ -0,0 +1 @@ +key= = 1 diff --git a/test-suite/tests/invalid/key-two-equals.toml b/test-suite/tests/invalid/key-two-equals.toml deleted file mode 100644 index 25a0378..0000000 --- a/test-suite/tests/invalid/key-two-equals.toml +++ /dev/null @@ -1 +0,0 @@ -key= = 1 diff --git a/test-suite/tests/invalid/string-bad-byte-escape.milf b/test-suite/tests/invalid/string-bad-byte-escape.milf new file mode 100644 index 0000000..4c7be59 --- /dev/null +++ b/test-suite/tests/invalid/string-bad-byte-escape.milf @@ -0,0 +1 @@ +naughty = "\xAg" diff --git a/test-suite/tests/invalid/string-bad-byte-escape.toml b/test-suite/tests/invalid/string-bad-byte-escape.toml deleted file mode 100644 index 4c7be59..0000000 --- a/test-suite/tests/invalid/string-bad-byte-escape.toml +++ /dev/null @@ -1 +0,0 @@ -naughty = "\xAg" diff --git a/test-suite/tests/invalid/string-bad-escape.milf b/test-suite/tests/invalid/string-bad-escape.milf new file mode 100644 index 0000000..60acb0c --- /dev/null +++ b/test-suite/tests/invalid/string-bad-escape.milf @@ -0,0 +1 @@ +invalid-escape = "This string has a bad \a escape character." diff --git a/test-suite/tests/invalid/string-bad-escape.toml b/test-suite/tests/invalid/string-bad-escape.toml deleted file mode 100644 index 60acb0c..0000000 --- a/test-suite/tests/invalid/string-bad-escape.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-escape = "This string has a bad \a escape character." diff --git a/test-suite/tests/invalid/string-bad-line-ending-escape.milf b/test-suite/tests/invalid/string-bad-line-ending-escape.milf new file mode 100644 index 0000000..32e2c48 --- /dev/null +++ b/test-suite/tests/invalid/string-bad-line-ending-escape.milf @@ -0,0 +1,3 @@ +invalid-escape = """\ + This string has a non whitespace-character after the line ending escape. \ a +""" diff --git a/test-suite/tests/invalid/string-bad-line-ending-escape.toml b/test-suite/tests/invalid/string-bad-line-ending-escape.toml deleted file mode 100644 index 32e2c48..0000000 --- a/test-suite/tests/invalid/string-bad-line-ending-escape.toml +++ /dev/null @@ -1,3 +0,0 @@ -invalid-escape = """\ - This string has a non whitespace-character after the line ending escape. \ a -""" diff --git a/test-suite/tests/invalid/string-byte-escapes.milf b/test-suite/tests/invalid/string-byte-escapes.milf new file mode 100644 index 0000000..e94452a --- /dev/null +++ b/test-suite/tests/invalid/string-byte-escapes.milf @@ -0,0 +1 @@ +answer = "\x33" diff --git a/test-suite/tests/invalid/string-byte-escapes.toml b/test-suite/tests/invalid/string-byte-escapes.toml deleted file mode 100644 index e94452a..0000000 --- a/test-suite/tests/invalid/string-byte-escapes.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "\x33" diff --git a/test-suite/tests/invalid/string-no-close.milf b/test-suite/tests/invalid/string-no-close.milf new file mode 100644 index 0000000..0c292fc --- /dev/null +++ b/test-suite/tests/invalid/string-no-close.milf @@ -0,0 +1 @@ +no-ending-quote = "One time, at band camp diff --git a/test-suite/tests/invalid/string-no-close.toml b/test-suite/tests/invalid/string-no-close.toml deleted file mode 100644 index 0c292fc..0000000 --- a/test-suite/tests/invalid/string-no-close.toml +++ /dev/null @@ -1 +0,0 @@ -no-ending-quote = "One time, at band camp diff --git a/test-suite/tests/invalid/table-array-implicit.milf b/test-suite/tests/invalid/table-array-implicit.milf new file mode 100644 index 0000000..a0b4e0c --- /dev/null +++ b/test-suite/tests/invalid/table-array-implicit.milf @@ -0,0 +1,14 @@ +# This test is a bit tricky. It should fail because the first use of +# `[[albums.songs]]` without first declaring `albums` implies that `albums` +# must be a table. The alternative would be quite weird. Namely, it wouldn't +# comply with the MILF spec: "Each double-bracketed sub-table will belong to +# the most *recently* defined table element *above* it." +# +# This is in contrast to the *valid* test, table-array-implicit where +# `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared +# later. (Although, `[albums]` could be.) +[[albums.songs]] +name = "Glory Days" + +[[albums]] +name = "Born in the USA" diff --git a/test-suite/tests/invalid/table-array-implicit.toml b/test-suite/tests/invalid/table-array-implicit.toml deleted file mode 100644 index 05f2507..0000000 --- a/test-suite/tests/invalid/table-array-implicit.toml +++ /dev/null @@ -1,14 +0,0 @@ -# This test is a bit tricky. It should fail because the first use of -# `[[albums.songs]]` without first declaring `albums` implies that `albums` -# must be a table. The alternative would be quite weird. Namely, it wouldn't -# comply with the TOML spec: "Each double-bracketed sub-table will belong to -# the most *recently* defined table element *above* it." -# -# This is in contrast to the *valid* test, table-array-implicit where -# `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared -# later. (Although, `[albums]` could be.) -[[albums.songs]] -name = "Glory Days" - -[[albums]] -name = "Born in the USA" diff --git a/test-suite/tests/invalid/table-array-malformed-bracket.milf b/test-suite/tests/invalid/table-array-malformed-bracket.milf new file mode 100644 index 0000000..39c73b0 --- /dev/null +++ b/test-suite/tests/invalid/table-array-malformed-bracket.milf @@ -0,0 +1,2 @@ +[[albums] +name = "Born to Run" diff --git a/test-suite/tests/invalid/table-array-malformed-bracket.toml b/test-suite/tests/invalid/table-array-malformed-bracket.toml deleted file mode 100644 index 39c73b0..0000000 --- a/test-suite/tests/invalid/table-array-malformed-bracket.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[albums] -name = "Born to Run" diff --git a/test-suite/tests/invalid/table-array-malformed-empty.milf b/test-suite/tests/invalid/table-array-malformed-empty.milf new file mode 100644 index 0000000..a470ca3 --- /dev/null +++ b/test-suite/tests/invalid/table-array-malformed-empty.milf @@ -0,0 +1,2 @@ +[[]] +name = "Born to Run" diff --git a/test-suite/tests/invalid/table-array-malformed-empty.toml b/test-suite/tests/invalid/table-array-malformed-empty.toml deleted file mode 100644 index a470ca3..0000000 --- a/test-suite/tests/invalid/table-array-malformed-empty.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[]] -name = "Born to Run" diff --git a/test-suite/tests/invalid/table-empty.milf b/test-suite/tests/invalid/table-empty.milf new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test-suite/tests/invalid/table-empty.milf @@ -0,0 +1 @@ +[] diff --git a/test-suite/tests/invalid/table-empty.toml b/test-suite/tests/invalid/table-empty.toml deleted file mode 100644 index fe51488..0000000 --- a/test-suite/tests/invalid/table-empty.toml +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/test-suite/tests/invalid/table-nested-brackets-close.milf b/test-suite/tests/invalid/table-nested-brackets-close.milf new file mode 100644 index 0000000..c8b5a67 --- /dev/null +++ b/test-suite/tests/invalid/table-nested-brackets-close.milf @@ -0,0 +1,2 @@ +[a]b] +zyx = 42 diff --git a/test-suite/tests/invalid/table-nested-brackets-close.toml b/test-suite/tests/invalid/table-nested-brackets-close.toml deleted file mode 100644 index c8b5a67..0000000 --- a/test-suite/tests/invalid/table-nested-brackets-close.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a]b] -zyx = 42 diff --git a/test-suite/tests/invalid/table-nested-brackets-open.milf b/test-suite/tests/invalid/table-nested-brackets-open.milf new file mode 100644 index 0000000..246d7e9 --- /dev/null +++ b/test-suite/tests/invalid/table-nested-brackets-open.milf @@ -0,0 +1,2 @@ +[a[b] +zyx = 42 diff --git a/test-suite/tests/invalid/table-nested-brackets-open.toml b/test-suite/tests/invalid/table-nested-brackets-open.toml deleted file mode 100644 index 246d7e9..0000000 --- a/test-suite/tests/invalid/table-nested-brackets-open.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a[b] -zyx = 42 diff --git a/test-suite/tests/invalid/table-whitespace.milf b/test-suite/tests/invalid/table-whitespace.milf new file mode 100644 index 0000000..79bbcb1 --- /dev/null +++ b/test-suite/tests/invalid/table-whitespace.milf @@ -0,0 +1 @@ +[invalid key] \ No newline at end of file diff --git a/test-suite/tests/invalid/table-whitespace.toml b/test-suite/tests/invalid/table-whitespace.toml deleted file mode 100644 index 79bbcb1..0000000 --- a/test-suite/tests/invalid/table-whitespace.toml +++ /dev/null @@ -1 +0,0 @@ -[invalid key] \ No newline at end of file diff --git a/test-suite/tests/invalid/table-with-pound.milf b/test-suite/tests/invalid/table-with-pound.milf new file mode 100644 index 0000000..0d8edb5 --- /dev/null +++ b/test-suite/tests/invalid/table-with-pound.milf @@ -0,0 +1,2 @@ +[key#group] +answer = 42 \ No newline at end of file diff --git a/test-suite/tests/invalid/table-with-pound.toml b/test-suite/tests/invalid/table-with-pound.toml deleted file mode 100644 index 0d8edb5..0000000 --- a/test-suite/tests/invalid/table-with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -[key#group] -answer = 42 \ No newline at end of file diff --git a/test-suite/tests/invalid/text-after-array-entries.milf b/test-suite/tests/invalid/text-after-array-entries.milf new file mode 100644 index 0000000..1a72890 --- /dev/null +++ b/test-suite/tests/invalid/text-after-array-entries.milf @@ -0,0 +1,4 @@ +array = [ + "Is there life after an array separator?", No + "Entry" +] diff --git a/test-suite/tests/invalid/text-after-array-entries.toml b/test-suite/tests/invalid/text-after-array-entries.toml deleted file mode 100644 index 1a72890..0000000 --- a/test-suite/tests/invalid/text-after-array-entries.toml +++ /dev/null @@ -1,4 +0,0 @@ -array = [ - "Is there life after an array separator?", No - "Entry" -] diff --git a/test-suite/tests/invalid/text-after-integer.milf b/test-suite/tests/invalid/text-after-integer.milf new file mode 100644 index 0000000..42de7af --- /dev/null +++ b/test-suite/tests/invalid/text-after-integer.milf @@ -0,0 +1 @@ +answer = 42 the ultimate answer? diff --git a/test-suite/tests/invalid/text-after-integer.toml b/test-suite/tests/invalid/text-after-integer.toml deleted file mode 100644 index 42de7af..0000000 --- a/test-suite/tests/invalid/text-after-integer.toml +++ /dev/null @@ -1 +0,0 @@ -answer = 42 the ultimate answer? diff --git a/test-suite/tests/invalid/text-after-string.milf b/test-suite/tests/invalid/text-after-string.milf new file mode 100644 index 0000000..c92a6f1 --- /dev/null +++ b/test-suite/tests/invalid/text-after-string.milf @@ -0,0 +1 @@ +string = "Is there life after strings?" No. diff --git a/test-suite/tests/invalid/text-after-string.toml b/test-suite/tests/invalid/text-after-string.toml deleted file mode 100644 index c92a6f1..0000000 --- a/test-suite/tests/invalid/text-after-string.toml +++ /dev/null @@ -1 +0,0 @@ -string = "Is there life after strings?" No. diff --git a/test-suite/tests/invalid/text-after-table.milf b/test-suite/tests/invalid/text-after-table.milf new file mode 100644 index 0000000..87da9db --- /dev/null +++ b/test-suite/tests/invalid/text-after-table.milf @@ -0,0 +1 @@ +[error] this shouldn't be here diff --git a/test-suite/tests/invalid/text-after-table.toml b/test-suite/tests/invalid/text-after-table.toml deleted file mode 100644 index 87da9db..0000000 --- a/test-suite/tests/invalid/text-after-table.toml +++ /dev/null @@ -1 +0,0 @@ -[error] this shouldn't be here diff --git a/test-suite/tests/invalid/text-before-array-separator.milf b/test-suite/tests/invalid/text-before-array-separator.milf new file mode 100644 index 0000000..9b06a39 --- /dev/null +++ b/test-suite/tests/invalid/text-before-array-separator.milf @@ -0,0 +1,4 @@ +array = [ + "Is there life before an array separator?" No, + "Entry" +] diff --git a/test-suite/tests/invalid/text-before-array-separator.toml b/test-suite/tests/invalid/text-before-array-separator.toml deleted file mode 100644 index 9b06a39..0000000 --- a/test-suite/tests/invalid/text-before-array-separator.toml +++ /dev/null @@ -1,4 +0,0 @@ -array = [ - "Is there life before an array separator?" No, - "Entry" -] diff --git a/test-suite/tests/invalid/text-in-array.milf b/test-suite/tests/invalid/text-in-array.milf new file mode 100644 index 0000000..a6a6c42 --- /dev/null +++ b/test-suite/tests/invalid/text-in-array.milf @@ -0,0 +1,5 @@ +array = [ + "Entry 1", + I don't belong, + "Entry 2", +] diff --git a/test-suite/tests/invalid/text-in-array.toml b/test-suite/tests/invalid/text-in-array.toml deleted file mode 100644 index a6a6c42..0000000 --- a/test-suite/tests/invalid/text-in-array.toml +++ /dev/null @@ -1,5 +0,0 @@ -array = [ - "Entry 1", - I don't belong, - "Entry 2", -] diff --git a/test-suite/tests/macros.rs b/test-suite/tests/macros.rs index 20831a0..3cc5e81 100644 --- a/test-suite/tests/macros.rs +++ b/test-suite/tests/macros.rs @@ -1,7 +1,7 @@ #![recursion_limit = "256"] #[macro_use] -extern crate toml; +extern crate milf; use std::f64; @@ -9,11 +9,11 @@ macro_rules! table { ($($key:expr => $value:expr,)*) => {{ // https://github.com/rust-lang/rust/issues/60643 #[allow(unused_mut)] - let mut table = toml::value::Table::new(); + let mut table = milf::value::Table::new(); $( table.insert($key.to_string(), $value.into()); )* - toml::Value::Table(table) + milf::Value::Table(table) }}; } @@ -21,22 +21,22 @@ macro_rules! array { ($($element:expr,)*) => {{ // https://github.com/rust-lang/rust/issues/60643 #[allow(unused_mut)] - let mut array = toml::value::Array::new(); + let mut array = milf::value::Array::new(); $( array.push($element.into()); )* - toml::Value::Array(array) + milf::Value::Array(array) }}; } macro_rules! datetime { ($s:tt) => { - $s.parse::().unwrap() + $s.parse::().unwrap() }; } #[test] -fn test_cargo_toml() { +fn test_cargo_milf() { // Simple sanity check of: // // - Ordinary tables @@ -45,9 +45,9 @@ fn test_cargo_toml() { // - String values // - Table keys containing hyphen // - Table headers containing hyphen - let actual = toml! { + let actual = milf! { [package] - name = "toml" + name = "milf" version = "0.4.5" authors = ["Alex Crichton "] @@ -64,7 +64,7 @@ fn test_cargo_toml() { let expected = table! { "package" => table! { - "name" => "toml".to_owned(), + "name" => "milf".to_owned(), "version" => "0.4.5".to_owned(), "authors" => array! { "Alex Crichton ".to_owned(), @@ -89,8 +89,8 @@ fn test_cargo_toml() { #[test] fn test_array() { - // Copied from the TOML spec. - let actual = toml! { + // Copied from the MILF spec. + let actual = milf! { [[fruit]] name = "apple" @@ -144,7 +144,7 @@ fn test_array() { #[test] fn test_number() { - let actual = toml! { + let actual = milf! { positive = 1 negative = -1 table = { positive = 1, negative = -1 } @@ -193,7 +193,7 @@ fn test_number() { #[test] fn test_nan() { - let actual = toml! { + let actual = milf! { sf4 = nan sf5 = +nan sf6 = -nan @@ -205,8 +205,8 @@ fn test_nan() { #[test] fn test_datetime() { - let actual = toml! { - // Copied from the TOML spec. + let actual = milf! { + // Copied from the MILF spec. odt1 = 1979-05-27T07:32:00Z odt2 = 1979-05-27T00:32:00-07:00 odt3 = 1979-05-27T00:32:00.999999-07:00 @@ -284,7 +284,7 @@ fn test_datetime() { // This test requires rustc >= 1.20. #[test] fn test_quoted_key() { - let actual = toml! { + let actual = milf! { "quoted" = true table = { "quoted" = true } @@ -311,7 +311,7 @@ fn test_quoted_key() { #[test] fn test_empty() { - let actual = toml! { + let actual = milf! { empty_inline_table = {} empty_inline_array = [] @@ -334,7 +334,7 @@ fn test_empty() { #[test] fn test_dotted_keys() { - let actual = toml! { + let actual = milf! { a.b = 123 a.c = 1979-05-27T07:32:00Z [table] diff --git a/test-suite/tests/parser.rs b/test-suite/tests/parser.rs index 169df79..0d14803 100644 --- a/test-suite/tests/parser.rs +++ b/test-suite/tests/parser.rs @@ -1,10 +1,10 @@ -extern crate toml; +extern crate milf; -use toml::Value; +use milf::Value; macro_rules! bad { - ($toml:expr, $msg:expr) => { - match $toml.parse::() { + ($milf:expr, $msg:expr) => { + match $milf.parse::() { Ok(s) => panic!("parsed to: {:#?}", s), Err(e) => assert_eq!(e.to_string(), $msg), } @@ -493,7 +493,7 @@ fn bad_underscores() { bad!("foo = 0__0", "invalid number at line 1 column 7"); bad!( "foo = __0", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!("foo = 1_0_", "invalid number at line 1 column 7"); } @@ -540,19 +540,19 @@ fn booleans() { bad!( "foo = true2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = false2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = t1", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); bad!( "foo = f2", - "invalid TOML value, did you mean to use a quoted string? at line 1 column 7" + "invalid MILF value, did you mean to use a quoted string? at line 1 column 7" ); } @@ -643,8 +643,8 @@ fn datetimes() { macro_rules! t { ($actual:expr) => {{ let f = format!("foo = {}", $actual); - let toml = f.parse::().expect(&format!("failed: {}", f)); - assert_eq!(toml["foo"].as_datetime().unwrap().to_string(), $actual); + let milf = f.parse::().expect(&format!("failed: {}", f)); + assert_eq!(milf["foo"].as_datetime().unwrap().to_string(), $actual); }}; } diff --git a/test-suite/tests/pretty.rs b/test-suite/tests/pretty.rs index 0c65e0f..ee9f4f8 100644 --- a/test-suite/tests/pretty.rs +++ b/test-suite/tests/pretty.rs @@ -1,5 +1,5 @@ extern crate serde; -extern crate toml; +extern crate milf; use serde::ser::Serialize; @@ -13,31 +13,31 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] fn no_pretty() { - let toml = NO_PRETTY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = NO_PRETTY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::new(&mut result)) + .serialize(&mut milf::Serializer::new(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } #[test] fn disable_pretty() { - let toml = NO_PRETTY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = NO_PRETTY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); serializer.pretty_array(false); value.serialize(&mut serializer).unwrap(); } - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_STD: &'static str = "\ @@ -57,15 +57,15 @@ this is the second line #[test] fn pretty_std() { - let toml = PRETTY_STD; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_STD; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_INDENT_2: &'static str = "\ @@ -90,16 +90,16 @@ three = [ #[test] fn pretty_indent_2() { - let toml = PRETTY_INDENT_2; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_INDENT_2; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array_indent(2); value.serialize(&mut serializer).unwrap(); } println!(">> Result:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_INDENT_2_OTHER: &'static str = "\ @@ -116,15 +116,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_indent_2_other() { - let toml = PRETTY_INDENT_2_OTHER; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_INDENT_2_OTHER; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_indent(2); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_ARRAY_NO_COMMA: &'static str = "\ @@ -140,15 +140,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_indent_array_no_comma() { - let toml = PRETTY_ARRAY_NO_COMMA; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_ARRAY_NO_COMMA; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_trailing_comma(false); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_NO_STRING: &'static str = "\ @@ -164,15 +164,15 @@ text = \"\\nthis is the first line\\nthis is the second line\\n\" #[test] /// Test pretty indent when gotten the other way fn pretty_no_string() { - let toml = PRETTY_NO_STRING; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_NO_STRING; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); value.serialize(&mut serializer).unwrap(); } - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TRICKY: &'static str = r##"[example] @@ -204,15 +204,15 @@ this is the fourth line #[test] fn pretty_tricky() { - let toml = PRETTY_TRICKY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TRICKY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TABLE_ARRAY: &'static str = r##"[[array]] @@ -230,15 +230,15 @@ single = 'this is a single line string' #[test] fn pretty_table_array() { - let toml = PRETTY_TABLE_ARRAY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TABLE_ARRAY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::pretty(&mut result)) + .serialize(&mut milf::Serializer::pretty(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const TABLE_ARRAY: &'static str = r##"[[array]] @@ -256,15 +256,15 @@ single = "this is a single line string" #[test] fn table_array() { - let toml = TABLE_ARRAY; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = TABLE_ARRAY; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); value - .serialize(&mut toml::Serializer::new(&mut result)) + .serialize(&mut milf::Serializer::new(&mut result)) .unwrap(); - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } const PRETTY_TRICKY_NON_LITERAL: &'static str = r##"[example] @@ -300,15 +300,15 @@ this is the fourth line #[test] fn pretty_tricky_non_literal() { - let toml = PRETTY_TRICKY_NON_LITERAL; - let value: toml::Value = toml::from_str(toml).unwrap(); + let milf = PRETTY_TRICKY_NON_LITERAL; + let value: milf::Value = milf::from_str(milf).unwrap(); let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string_literal(false); value.serialize(&mut serializer).unwrap(); } - println!("EXPECTED:\n{}", toml); + println!("EXPECTED:\n{}", milf); println!("\nRESULT:\n{}", result); - assert_eq!(toml, &result); + assert_eq!(milf, &result); } diff --git a/test-suite/tests/serde.rs b/test-suite/tests/serde.rs index 56172bd..712d2c5 100644 --- a/test-suite/tests/serde.rs +++ b/test-suite/tests/serde.rs @@ -1,15 +1,15 @@ extern crate serde; extern crate serde_json; -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; use serde::{Deserialize, Deserializer}; use std::collections::{BTreeMap, HashSet}; -use toml::map::Map; -use toml::Value; -use toml::Value::{Array, Float, Integer, Table}; +use milf::map::Map; +use milf::Value; +use milf::Value::{Array, Float, Integer, Table}; macro_rules! t { ($e:expr) => { @@ -21,38 +21,38 @@ macro_rules! t { } macro_rules! equivalent { - ($literal:expr, $toml:expr,) => {{ - let toml = $toml; + ($literal:expr, $milf:expr,) => {{ + let milf = $milf; let literal = $literal; // In/out of Value is equivalent println!("try_from"); - assert_eq!(t!(Value::try_from(literal.clone())), toml); + assert_eq!(t!(Value::try_from(literal.clone())), milf); println!("try_into"); - assert_eq!(literal, t!(toml.clone().try_into())); + assert_eq!(literal, t!(milf.clone().try_into())); // Through a string equivalent println!("to_string(literal)"); - assert_eq!(t!(toml::to_string(&literal)), toml.to_string()); - println!("to_string(toml)"); - assert_eq!(t!(toml::to_string(&toml)), toml.to_string()); - println!("literal, from_str(toml)"); - assert_eq!(literal, t!(toml::from_str(&toml.to_string()))); - println!("toml, from_str(toml)"); - assert_eq!(toml, t!(toml::from_str(&toml.to_string()))); + assert_eq!(t!(milf::to_string(&literal)), milf.to_string()); + println!("to_string(milf)"); + assert_eq!(t!(milf::to_string(&milf)), milf.to_string()); + println!("literal, from_str(milf)"); + assert_eq!(literal, t!(milf::from_str(&milf.to_string()))); + println!("milf, from_str(milf)"); + assert_eq!(milf, t!(milf::from_str(&milf.to_string()))); }}; } macro_rules! error { - ($ty:ty, $toml:expr, $msg_parse:expr, $msg_decode:expr) => {{ + ($ty:ty, $milf:expr, $msg_parse:expr, $msg_decode:expr) => {{ println!("attempting parsing"); - match toml::from_str::<$ty>(&$toml.to_string()) { + match milf::from_str::<$ty>(&$milf.to_string()) { Ok(_) => panic!("successful"), Err(e) => assert_eq!(e.to_string(), $msg_parse), } - println!("attempting toml decoding"); - match $toml.try_into::<$ty>() { + println!("attempting milf decoding"); + match $milf.try_into::<$ty>() { Ok(_) => panic!("successful"), Err(e) => assert_eq!(e.to_string(), $msg_decode), } @@ -376,7 +376,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // b, Integer(5) // }))); // } @@ -397,7 +397,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // a, Table(map! { // b, Integer(5) // }) @@ -419,7 +419,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -435,7 +435,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -449,7 +449,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -463,7 +463,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, None); +// assert_eq!(d.milf, None); // } // // #[test] @@ -482,7 +482,7 @@ fn parse_enum_string() { // })); // assert_eq!(v, t!(Deserialize::deserialize(&mut d))); // -// assert_eq!(d.toml, Some(Table(map! { +// assert_eq!(d.milf, Some(Table(map! { // a, Array(vec![Table(map! { // b, Integer(2) // })]) @@ -531,9 +531,9 @@ fn extra_keys() { a: isize, } - let toml = Table(map! { a: Integer(2), b: Integer(2) }); - assert!(toml.clone().try_into::().is_ok()); - assert!(toml::from_str::(&toml.to_string()).is_ok()); + let milf = Table(map! { a: Integer(2), b: Integer(2) }); + assert!(milf.clone().try_into::().is_ok()); + assert!(milf::from_str::(&milf.to_string()).is_ok()); } #[test] @@ -590,7 +590,7 @@ struct CanBeEmpty { #[test] fn table_structs_empty() { let text = "[bar]\n\n[baz]\n\n[bazv]\na = \"foo\"\n\n[foo]\n"; - let value: BTreeMap = toml::from_str(text).unwrap(); + let value: BTreeMap = milf::from_str(text).unwrap(); let mut expected: BTreeMap = BTreeMap::new(); expected.insert("bar".to_string(), CanBeEmpty::default()); expected.insert("baz".to_string(), CanBeEmpty::default()); @@ -603,7 +603,7 @@ fn table_structs_empty() { ); expected.insert("foo".to_string(), CanBeEmpty::default()); assert_eq!(value, expected); - assert_eq!(toml::to_string(&value).unwrap(), text); + assert_eq!(milf::to_string(&value).unwrap(), text); } #[test] @@ -671,7 +671,7 @@ fn homogeneous_tuple_struct() { fn json_interoperability() { #[derive(Serialize, Deserialize)] struct Foo { - any: toml::Value, + any: milf::Value, } let _foo: Foo = serde_json::from_str( diff --git a/test-suite/tests/spanned-impls.rs b/test-suite/tests/spanned-impls.rs index cb12b1a..eb95673 100644 --- a/test-suite/tests/spanned-impls.rs +++ b/test-suite/tests/spanned-impls.rs @@ -1,5 +1,5 @@ use std::cmp::{Ord, Ordering, PartialOrd}; -use toml::{from_str, Spanned}; +use milf::{from_str, Spanned}; #[macro_use] extern crate serde_derive; diff --git a/test-suite/tests/spanned.rs b/test-suite/tests/spanned.rs index d8f7a12..a8d29d4 100644 --- a/test-suite/tests/spanned.rs +++ b/test-suite/tests/spanned.rs @@ -1,12 +1,12 @@ extern crate serde; -extern crate toml; +extern crate milf; #[macro_use] extern crate serde_derive; use std::collections::HashMap; use std::fmt::Debug; -use toml::value::Datetime; -use toml::Spanned; +use milf::value::Datetime; +use milf::Spanned; /// A set of good datetimes. pub fn good_datetimes() -> Vec<&'static str> { @@ -41,7 +41,7 @@ fn test_spanned_field() { where T: serde::Deserialize<'de> + Debug + PartialEq, { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); assert_eq!(6, foo.foo.start()); if let Some(end) = end { @@ -52,7 +52,7 @@ fn test_spanned_field() { assert_eq!(expected, &s[foo.foo.start()..foo.foo.end()]); // Test for Spanned<> at the top level - let foo_outer: Spanned> = toml::from_str(s).unwrap(); + let foo_outer: Spanned> = milf::from_str(s).unwrap(); assert_eq!(0, foo_outer.start()); assert_eq!(s.len(), foo_outer.end()); @@ -94,13 +94,13 @@ fn test_inner_spanned_table() { } fn good(s: &str, zero: bool) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); if zero { assert_eq!(foo.foo.start(), 0); // We'd actually have to assert equality with s.len() here, // but the current implementation doesn't support that, - // and it's not possible with toml's data format to support it + // and it's not possible with milf's data format to support it // in the general case as spans aren't always well-defined. // So this check mainly serves as a reminder that this test should // be updated *if* one day there is support for emitting the actual span. @@ -141,7 +141,7 @@ fn test_outer_spanned_table() { } fn good(s: &str) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); for (k, v) in foo.foo.iter() { assert_eq!(&s[k.start()..k.end()], k.get_ref()); @@ -174,7 +174,7 @@ fn test_spanned_nested() { } fn good(s: &str) { - let foo: Foo = toml::from_str(s).unwrap(); + let foo: Foo = milf::from_str(s).unwrap(); for (k, v) in foo.foo.iter() { assert_eq!(&s[k.start()..k.end()], k.get_ref()); @@ -214,13 +214,13 @@ fn test_spanned_array() { } fn good(s: &str) { - let foo_list: Foo = toml::from_str(s).unwrap(); + let foo_list: Foo = milf::from_str(s).unwrap(); for foo in foo_list.foo.iter() { assert_eq!(foo.start(), 0); // We'd actually have to assert equality with s.len() here, // but the current implementation doesn't support that, - // and it's not possible with toml's data format to support it + // and it's not possible with milf's data format to support it // in the general case as spans aren't always well-defined. // So this check mainly serves as a reminder that this test should // be updated *if* one day there is support for emitting the actual span. diff --git a/test-suite/tests/tables-last.rs b/test-suite/tests/tables-last.rs index b885a42..ae427e4 100644 --- a/test-suite/tests/tables-last.rs +++ b/test-suite/tests/tables-last.rs @@ -1,12 +1,12 @@ #[macro_use] extern crate serde_derive; -extern crate toml; +extern crate milf; use std::collections::HashMap; #[derive(Serialize)] struct A { - #[serde(serialize_with = "toml::ser::tables_last")] + #[serde(serialize_with = "milf::ser::tables_last")] vals: HashMap<&'static str, Value>, } @@ -28,5 +28,5 @@ fn always_works() { sub.insert("foo", "bar"); a.vals.insert("bar", Value::Map(sub)); - toml::to_string(&a).unwrap(); + milf::to_string(&a).unwrap(); } diff --git a/test-suite/tests/valid.rs b/test-suite/tests/valid.rs index 0745cc8..ddbaf1b 100644 --- a/test-suite/tests/valid.rs +++ b/test-suite/tests/valid.rs @@ -1,12 +1,12 @@ extern crate serde; extern crate serde_json; -extern crate toml; +extern crate milf; use serde::ser::Serialize; use serde_json::Value as Json; -use toml::{to_string_pretty, Value as Toml}; +use milf::{to_string_pretty, Value as Milf}; -fn to_json(toml: toml::Value) -> Json { +fn to_json(milf: milf::Value) -> Json { fn doit(s: &str, json: Json) -> Json { let mut map = serde_json::Map::new(); map.insert("type".to_string(), Json::String(s.to_string())); @@ -14,10 +14,10 @@ fn to_json(toml: toml::Value) -> Json { Json::Object(map) } - match toml { - Toml::String(s) => doit("string", Json::String(s)), - Toml::Integer(i) => doit("integer", Json::String(i.to_string())), - Toml::Float(f) => doit( + match milf { + Milf::String(s) => doit("string", Json::String(s)), + Milf::Integer(i) => doit("integer", Json::String(i.to_string())), + Milf::Float(f) => doit( "float", Json::String({ let s = format!("{:.15}", f); @@ -29,11 +29,11 @@ fn to_json(toml: toml::Value) -> Json { } }), ), - Toml::Boolean(b) => doit("bool", Json::String(format!("{}", b))), - Toml::Datetime(s) => doit("datetime", Json::String(s.to_string())), - Toml::Array(arr) => { + Milf::Boolean(b) => doit("bool", Json::String(format!("{}", b))), + Milf::Datetime(s) => doit("datetime", Json::String(s.to_string())), + Milf::Array(arr) => { let is_table = match arr.first() { - Some(&Toml::Table(..)) => true, + Some(&Milf::Table(..)) => true, _ => false, }; let json = Json::Array(arr.into_iter().map(to_json).collect()); @@ -43,7 +43,7 @@ fn to_json(toml: toml::Value) -> Json { doit("array", json) } } - Toml::Table(table) => { + Milf::Table(table) => { let mut map = serde_json::Map::new(); for (k, v) in table { map.insert(k, to_json(v)); @@ -53,345 +53,345 @@ fn to_json(toml: toml::Value) -> Json { } } -fn run_pretty(toml: Toml) { - // Assert toml == json +fn run_pretty(milf: Milf) { + // Assert milf == json println!("### pretty round trip parse."); // standard pretty - let toml_raw = to_string_pretty(&toml).expect("to string"); - let toml2 = toml_raw.parse().expect("from string"); - assert_eq!(toml, toml2); + let milf_raw = to_string_pretty(&milf).expect("to string"); + let milf2 = milf_raw.parse().expect("from string"); + assert_eq!(milf, milf2); // pretty with indent 2 let mut result = String::with_capacity(128); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array_indent(2); - toml.serialize(&mut serializer).expect("to string"); + milf.serialize(&mut serializer).expect("to string"); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::new(&mut result); + let mut serializer = milf::Serializer::new(&mut result); serializer.pretty_array_trailing_comma(false); - toml.serialize(&mut serializer).expect("to string"); + milf.serialize(&mut serializer).expect("to string"); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_string(false); - toml.serialize(&mut serializer).expect("to string"); - assert_eq!(toml, toml2); + milf.serialize(&mut serializer).expect("to string"); + assert_eq!(milf, milf2); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); result.clear(); { - let mut serializer = toml::Serializer::pretty(&mut result); + let mut serializer = milf::Serializer::pretty(&mut result); serializer.pretty_array(false); - toml.serialize(&mut serializer).expect("to string"); - assert_eq!(toml, toml2); + milf.serialize(&mut serializer).expect("to string"); + assert_eq!(milf, milf2); } - assert_eq!(toml, result.parse().expect("from str")); + assert_eq!(milf, result.parse().expect("from str")); } -fn run(toml_raw: &str, json_raw: &str) { - println!("parsing:\n{}", toml_raw); - let toml: Toml = toml_raw.parse().unwrap(); +fn run(milf_raw: &str, json_raw: &str) { + println!("parsing:\n{}", milf_raw); + let milf: Milf = milf_raw.parse().unwrap(); let json: Json = json_raw.parse().unwrap(); - // Assert toml == json - let toml_json = to_json(toml.clone()); + // Assert milf == json + let milf_json = to_json(milf.clone()); assert!( - json == toml_json, + json == milf_json, "expected\n{}\ngot\n{}\n", serde_json::to_string_pretty(&json).unwrap(), - serde_json::to_string_pretty(&toml_json).unwrap() + serde_json::to_string_pretty(&milf_json).unwrap() ); // Assert round trip - println!("round trip parse: {}", toml); - let toml2 = toml.to_string().parse().unwrap(); - assert_eq!(toml, toml2); - run_pretty(toml); + println!("round trip parse: {}", milf); + let milf2 = milf.to_string().parse().unwrap(); + assert_eq!(milf, milf2); + run_pretty(milf); } -macro_rules! test( ($name:ident, $toml:expr, $json:expr) => ( +macro_rules! test( ($name:ident, $milf:expr, $json:expr) => ( #[test] - fn $name() { run($toml, $json); } + fn $name() { run($milf, $json); } ) ); test!( array_empty, - include_str!("valid/array-empty.toml"), + include_str!("valid/array-empty.milf"), include_str!("valid/array-empty.json") ); test!( array_nospaces, - include_str!("valid/array-nospaces.toml"), + include_str!("valid/array-nospaces.milf"), include_str!("valid/array-nospaces.json") ); test!( arrays_hetergeneous, - include_str!("valid/arrays-hetergeneous.toml"), + include_str!("valid/arrays-hetergeneous.milf"), include_str!("valid/arrays-hetergeneous.json") ); test!( arrays, - include_str!("valid/arrays.toml"), + include_str!("valid/arrays.milf"), include_str!("valid/arrays.json") ); test!( arrays_nested, - include_str!("valid/arrays-nested.toml"), + include_str!("valid/arrays-nested.milf"), include_str!("valid/arrays-nested.json") ); test!( array_mixed_types_ints_and_floats, - include_str!("valid/array-mixed-types-ints-and-floats.toml"), + include_str!("valid/array-mixed-types-ints-and-floats.milf"), include_str!("valid/array-mixed-types-ints-and-floats.json") ); test!( array_mixed_types_arrays_and_ints, - include_str!("valid/array-mixed-types-arrays-and-ints.toml"), + include_str!("valid/array-mixed-types-arrays-and-ints.milf"), include_str!("valid/array-mixed-types-arrays-and-ints.json") ); test!( array_mixed_types_strings_and_ints, - include_str!("valid/array-mixed-types-strings-and-ints.toml"), + include_str!("valid/array-mixed-types-strings-and-ints.milf"), include_str!("valid/array-mixed-types-strings-and-ints.json") ); test!( empty, - include_str!("valid/empty.toml"), + include_str!("valid/empty.milf"), include_str!("valid/empty.json") ); test!( bool, - include_str!("valid/bool.toml"), + include_str!("valid/bool.milf"), include_str!("valid/bool.json") ); test!( comments_everywhere, - include_str!("valid/comments-everywhere.toml"), + include_str!("valid/comments-everywhere.milf"), include_str!("valid/comments-everywhere.json") ); test!( datetime, - include_str!("valid/datetime.toml"), + include_str!("valid/datetime.milf"), include_str!("valid/datetime.json") ); test!( example, - include_str!("valid/example.toml"), + include_str!("valid/example.milf"), include_str!("valid/example.json") ); test!( float, - include_str!("valid/float.toml"), + include_str!("valid/float.milf"), include_str!("valid/float.json") ); test!( implicit_and_explicit_after, - include_str!("valid/implicit-and-explicit-after.toml"), + include_str!("valid/implicit-and-explicit-after.milf"), include_str!("valid/implicit-and-explicit-after.json") ); test!( implicit_and_explicit_before, - include_str!("valid/implicit-and-explicit-before.toml"), + include_str!("valid/implicit-and-explicit-before.milf"), include_str!("valid/implicit-and-explicit-before.json") ); test!( implicit_groups, - include_str!("valid/implicit-groups.toml"), + include_str!("valid/implicit-groups.milf"), include_str!("valid/implicit-groups.json") ); test!( integer, - include_str!("valid/integer.toml"), + include_str!("valid/integer.milf"), include_str!("valid/integer.json") ); test!( key_equals_nospace, - include_str!("valid/key-equals-nospace.toml"), + include_str!("valid/key-equals-nospace.milf"), include_str!("valid/key-equals-nospace.json") ); test!( key_space, - include_str!("valid/key-space.toml"), + include_str!("valid/key-space.milf"), include_str!("valid/key-space.json") ); test!( key_special_chars, - include_str!("valid/key-special-chars.toml"), + include_str!("valid/key-special-chars.milf"), include_str!("valid/key-special-chars.json") ); test!( key_with_pound, - include_str!("valid/key-with-pound.toml"), + include_str!("valid/key-with-pound.milf"), include_str!("valid/key-with-pound.json") ); test!( long_float, - include_str!("valid/long-float.toml"), + include_str!("valid/long-float.milf"), include_str!("valid/long-float.json") ); test!( long_integer, - include_str!("valid/long-integer.toml"), + include_str!("valid/long-integer.milf"), include_str!("valid/long-integer.json") ); test!( multiline_string, - include_str!("valid/multiline-string.toml"), + include_str!("valid/multiline-string.milf"), include_str!("valid/multiline-string.json") ); test!( raw_multiline_string, - include_str!("valid/raw-multiline-string.toml"), + include_str!("valid/raw-multiline-string.milf"), include_str!("valid/raw-multiline-string.json") ); test!( raw_string, - include_str!("valid/raw-string.toml"), + include_str!("valid/raw-string.milf"), include_str!("valid/raw-string.json") ); test!( string_empty, - include_str!("valid/string-empty.toml"), + include_str!("valid/string-empty.milf"), include_str!("valid/string-empty.json") ); test!( string_escapes, - include_str!("valid/string-escapes.toml"), + include_str!("valid/string-escapes.milf"), include_str!("valid/string-escapes.json") ); test!( string_simple, - include_str!("valid/string-simple.toml"), + include_str!("valid/string-simple.milf"), include_str!("valid/string-simple.json") ); test!( string_with_pound, - include_str!("valid/string-with-pound.toml"), + include_str!("valid/string-with-pound.milf"), include_str!("valid/string-with-pound.json") ); test!( table_array_implicit, - include_str!("valid/table-array-implicit.toml"), + include_str!("valid/table-array-implicit.milf"), include_str!("valid/table-array-implicit.json") ); test!( table_array_many, - include_str!("valid/table-array-many.toml"), + include_str!("valid/table-array-many.milf"), include_str!("valid/table-array-many.json") ); test!( table_array_nest, - include_str!("valid/table-array-nest.toml"), + include_str!("valid/table-array-nest.milf"), include_str!("valid/table-array-nest.json") ); test!( table_array_one, - include_str!("valid/table-array-one.toml"), + include_str!("valid/table-array-one.milf"), include_str!("valid/table-array-one.json") ); test!( table_empty, - include_str!("valid/table-empty.toml"), + include_str!("valid/table-empty.milf"), include_str!("valid/table-empty.json") ); test!( table_sub_empty, - include_str!("valid/table-sub-empty.toml"), + include_str!("valid/table-sub-empty.milf"), include_str!("valid/table-sub-empty.json") ); test!( table_multi_empty, - include_str!("valid/table-multi-empty.toml"), + include_str!("valid/table-multi-empty.milf"), include_str!("valid/table-multi-empty.json") ); test!( table_whitespace, - include_str!("valid/table-whitespace.toml"), + include_str!("valid/table-whitespace.milf"), include_str!("valid/table-whitespace.json") ); test!( table_with_pound, - include_str!("valid/table-with-pound.toml"), + include_str!("valid/table-with-pound.milf"), include_str!("valid/table-with-pound.json") ); test!( unicode_escape, - include_str!("valid/unicode-escape.toml"), + include_str!("valid/unicode-escape.milf"), include_str!("valid/unicode-escape.json") ); test!( unicode_literal, - include_str!("valid/unicode-literal.toml"), + include_str!("valid/unicode-literal.milf"), include_str!("valid/unicode-literal.json") ); test!( hard_example, - include_str!("valid/hard_example.toml"), + include_str!("valid/hard_example.milf"), include_str!("valid/hard_example.json") ); test!( example2, - include_str!("valid/example2.toml"), + include_str!("valid/example2.milf"), include_str!("valid/example2.json") ); test!( example3, - include_str!("valid/example-v0.3.0.toml"), + include_str!("valid/example-v0.3.0.milf"), include_str!("valid/example-v0.3.0.json") ); test!( example4, - include_str!("valid/example-v0.4.0.toml"), + include_str!("valid/example-v0.4.0.milf"), include_str!("valid/example-v0.4.0.json") ); test!( example_bom, - include_str!("valid/example-bom.toml"), + include_str!("valid/example-bom.milf"), include_str!("valid/example.json") ); test!( datetime_truncate, - include_str!("valid/datetime-truncate.toml"), + include_str!("valid/datetime-truncate.milf"), include_str!("valid/datetime-truncate.json") ); test!( key_quote_newline, - include_str!("valid/key-quote-newline.toml"), + include_str!("valid/key-quote-newline.milf"), include_str!("valid/key-quote-newline.json") ); test!( table_array_nest_no_keys, - include_str!("valid/table-array-nest-no-keys.toml"), + include_str!("valid/table-array-nest-no-keys.milf"), include_str!("valid/table-array-nest-no-keys.json") ); test!( dotted_keys, - include_str!("valid/dotted-keys.toml"), + include_str!("valid/dotted-keys.milf"), include_str!("valid/dotted-keys.json") ); test!( quote_surrounded_value, - include_str!("valid/quote-surrounded-value.toml"), + include_str!("valid/quote-surrounded-value.milf"), include_str!("valid/quote-surrounded-value.json") ); test!( float_exponent, - include_str!("valid/float-exponent.toml"), + include_str!("valid/float-exponent.milf"), include_str!("valid/float-exponent.json") ); test!( string_delim_end, - include_str!("valid/string-delim-end.toml"), + include_str!("valid/string-delim-end.milf"), include_str!("valid/string-delim-end.json") ); diff --git a/test-suite/tests/valid/array-empty.milf b/test-suite/tests/valid/array-empty.milf new file mode 100644 index 0000000..fa58dc6 --- /dev/null +++ b/test-suite/tests/valid/array-empty.milf @@ -0,0 +1 @@ +thevoid = [[[[[]]]]] diff --git a/test-suite/tests/valid/array-empty.toml b/test-suite/tests/valid/array-empty.toml deleted file mode 100644 index fa58dc6..0000000 --- a/test-suite/tests/valid/array-empty.toml +++ /dev/null @@ -1 +0,0 @@ -thevoid = [[[[[]]]]] diff --git a/test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf b/test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf new file mode 100644 index 0000000..051ec73 --- /dev/null +++ b/test-suite/tests/valid/array-mixed-types-arrays-and-ints.milf @@ -0,0 +1 @@ +arrays-and-ints = [1, ["Arrays are not integers."]] diff --git a/test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml b/test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml deleted file mode 100644 index 051ec73..0000000 --- a/test-suite/tests/valid/array-mixed-types-arrays-and-ints.toml +++ /dev/null @@ -1 +0,0 @@ -arrays-and-ints = [1, ["Arrays are not integers."]] diff --git a/test-suite/tests/valid/array-mixed-types-ints-and-floats.milf b/test-suite/tests/valid/array-mixed-types-ints-and-floats.milf new file mode 100644 index 0000000..a5aa9b7 --- /dev/null +++ b/test-suite/tests/valid/array-mixed-types-ints-and-floats.milf @@ -0,0 +1 @@ +ints-and-floats = [1, 1.1] diff --git a/test-suite/tests/valid/array-mixed-types-ints-and-floats.toml b/test-suite/tests/valid/array-mixed-types-ints-and-floats.toml deleted file mode 100644 index a5aa9b7..0000000 --- a/test-suite/tests/valid/array-mixed-types-ints-and-floats.toml +++ /dev/null @@ -1 +0,0 @@ -ints-and-floats = [1, 1.1] diff --git a/test-suite/tests/valid/array-mixed-types-strings-and-ints.milf b/test-suite/tests/valid/array-mixed-types-strings-and-ints.milf new file mode 100644 index 0000000..f348308 --- /dev/null +++ b/test-suite/tests/valid/array-mixed-types-strings-and-ints.milf @@ -0,0 +1 @@ +strings-and-ints = ["hi", 42] diff --git a/test-suite/tests/valid/array-mixed-types-strings-and-ints.toml b/test-suite/tests/valid/array-mixed-types-strings-and-ints.toml deleted file mode 100644 index f348308..0000000 --- a/test-suite/tests/valid/array-mixed-types-strings-and-ints.toml +++ /dev/null @@ -1 +0,0 @@ -strings-and-ints = ["hi", 42] diff --git a/test-suite/tests/valid/array-nospaces.milf b/test-suite/tests/valid/array-nospaces.milf new file mode 100644 index 0000000..6618936 --- /dev/null +++ b/test-suite/tests/valid/array-nospaces.milf @@ -0,0 +1 @@ +ints = [1,2,3] diff --git a/test-suite/tests/valid/array-nospaces.toml b/test-suite/tests/valid/array-nospaces.toml deleted file mode 100644 index 6618936..0000000 --- a/test-suite/tests/valid/array-nospaces.toml +++ /dev/null @@ -1 +0,0 @@ -ints = [1,2,3] diff --git a/test-suite/tests/valid/arrays-hetergeneous.milf b/test-suite/tests/valid/arrays-hetergeneous.milf new file mode 100644 index 0000000..a246fcf --- /dev/null +++ b/test-suite/tests/valid/arrays-hetergeneous.milf @@ -0,0 +1 @@ +mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/test-suite/tests/valid/arrays-hetergeneous.toml b/test-suite/tests/valid/arrays-hetergeneous.toml deleted file mode 100644 index a246fcf..0000000 --- a/test-suite/tests/valid/arrays-hetergeneous.toml +++ /dev/null @@ -1 +0,0 @@ -mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/test-suite/tests/valid/arrays-nested.milf b/test-suite/tests/valid/arrays-nested.milf new file mode 100644 index 0000000..ce33022 --- /dev/null +++ b/test-suite/tests/valid/arrays-nested.milf @@ -0,0 +1 @@ +nest = [["a"], ["b"]] diff --git a/test-suite/tests/valid/arrays-nested.toml b/test-suite/tests/valid/arrays-nested.toml deleted file mode 100644 index ce33022..0000000 --- a/test-suite/tests/valid/arrays-nested.toml +++ /dev/null @@ -1 +0,0 @@ -nest = [["a"], ["b"]] diff --git a/test-suite/tests/valid/arrays.milf b/test-suite/tests/valid/arrays.milf new file mode 100644 index 0000000..c435f57 --- /dev/null +++ b/test-suite/tests/valid/arrays.milf @@ -0,0 +1,8 @@ +ints = [1, 2, 3] +floats = [1.1, 2.1, 3.1] +strings = ["a", "b", "c"] +dates = [ + 1987-07-05T17:45:00Z, + 1979-05-27T07:32:00Z, + 2006-06-01T11:00:00Z, +] diff --git a/test-suite/tests/valid/arrays.toml b/test-suite/tests/valid/arrays.toml deleted file mode 100644 index c435f57..0000000 --- a/test-suite/tests/valid/arrays.toml +++ /dev/null @@ -1,8 +0,0 @@ -ints = [1, 2, 3] -floats = [1.1, 2.1, 3.1] -strings = ["a", "b", "c"] -dates = [ - 1987-07-05T17:45:00Z, - 1979-05-27T07:32:00Z, - 2006-06-01T11:00:00Z, -] diff --git a/test-suite/tests/valid/bool.milf b/test-suite/tests/valid/bool.milf new file mode 100644 index 0000000..a8a829b --- /dev/null +++ b/test-suite/tests/valid/bool.milf @@ -0,0 +1,2 @@ +t = true +f = false diff --git a/test-suite/tests/valid/bool.toml b/test-suite/tests/valid/bool.toml deleted file mode 100644 index a8a829b..0000000 --- a/test-suite/tests/valid/bool.toml +++ /dev/null @@ -1,2 +0,0 @@ -t = true -f = false diff --git a/test-suite/tests/valid/comments-everywhere.milf b/test-suite/tests/valid/comments-everywhere.milf new file mode 100644 index 0000000..3dca74c --- /dev/null +++ b/test-suite/tests/valid/comments-everywhere.milf @@ -0,0 +1,24 @@ +# Top comment. + # Top comment. +# Top comment. + +# [no-extraneous-groups-please] + +[group] # Comment +answer = 42 # Comment +# no-extraneous-keys-please = 999 +# Inbetween comment. +more = [ # Comment + # What about multiple # comments? + # Can you handle it? + # + # Evil. +# Evil. + 42, 42, # Comments within arrays are fun. + # What about multiple # comments? + # Can you handle it? + # + # Evil. +# Evil. +# ] Did I fool you? +] # Hopefully not. diff --git a/test-suite/tests/valid/comments-everywhere.toml b/test-suite/tests/valid/comments-everywhere.toml deleted file mode 100644 index 3dca74c..0000000 --- a/test-suite/tests/valid/comments-everywhere.toml +++ /dev/null @@ -1,24 +0,0 @@ -# Top comment. - # Top comment. -# Top comment. - -# [no-extraneous-groups-please] - -[group] # Comment -answer = 42 # Comment -# no-extraneous-keys-please = 999 -# Inbetween comment. -more = [ # Comment - # What about multiple # comments? - # Can you handle it? - # - # Evil. -# Evil. - 42, 42, # Comments within arrays are fun. - # What about multiple # comments? - # Can you handle it? - # - # Evil. -# Evil. -# ] Did I fool you? -] # Hopefully not. diff --git a/test-suite/tests/valid/datetime-truncate.milf b/test-suite/tests/valid/datetime-truncate.milf new file mode 100644 index 0000000..05de841 --- /dev/null +++ b/test-suite/tests/valid/datetime-truncate.milf @@ -0,0 +1 @@ +bestdayever = 1987-07-05T17:45:00.123456789012345Z diff --git a/test-suite/tests/valid/datetime-truncate.toml b/test-suite/tests/valid/datetime-truncate.toml deleted file mode 100644 index 05de841..0000000 --- a/test-suite/tests/valid/datetime-truncate.toml +++ /dev/null @@ -1 +0,0 @@ -bestdayever = 1987-07-05T17:45:00.123456789012345Z diff --git a/test-suite/tests/valid/datetime.milf b/test-suite/tests/valid/datetime.milf new file mode 100644 index 0000000..2e99340 --- /dev/null +++ b/test-suite/tests/valid/datetime.milf @@ -0,0 +1 @@ +bestdayever = 1987-07-05T17:45:00Z diff --git a/test-suite/tests/valid/datetime.toml b/test-suite/tests/valid/datetime.toml deleted file mode 100644 index 2e99340..0000000 --- a/test-suite/tests/valid/datetime.toml +++ /dev/null @@ -1 +0,0 @@ -bestdayever = 1987-07-05T17:45:00Z diff --git a/test-suite/tests/valid/dotted-keys.milf b/test-suite/tests/valid/dotted-keys.milf new file mode 100644 index 0000000..234d64c --- /dev/null +++ b/test-suite/tests/valid/dotted-keys.milf @@ -0,0 +1,7 @@ +a.b = 123 + +[table] +a.b.c = 1 +a . b . d = 2 + +in = { type.name = "cat", type.color = "blue" } diff --git a/test-suite/tests/valid/dotted-keys.toml b/test-suite/tests/valid/dotted-keys.toml deleted file mode 100644 index 234d64c..0000000 --- a/test-suite/tests/valid/dotted-keys.toml +++ /dev/null @@ -1,7 +0,0 @@ -a.b = 123 - -[table] -a.b.c = 1 -a . b . d = 2 - -in = { type.name = "cat", type.color = "blue" } diff --git a/test-suite/tests/valid/empty.milf b/test-suite/tests/valid/empty.milf new file mode 100644 index 0000000..e69de29 diff --git a/test-suite/tests/valid/empty.toml b/test-suite/tests/valid/empty.toml deleted file mode 100644 index e69de29..0000000 diff --git a/test-suite/tests/valid/example-bom.milf b/test-suite/tests/valid/example-bom.milf new file mode 100644 index 0000000..fb5ac81 --- /dev/null +++ b/test-suite/tests/valid/example-bom.milf @@ -0,0 +1,5 @@ +best-day-ever = 1987-07-05T17:45:00Z + +[numtheory] +boring = false +perfection = [6, 28, 496] diff --git a/test-suite/tests/valid/example-bom.toml b/test-suite/tests/valid/example-bom.toml deleted file mode 100644 index fb5ac81..0000000 --- a/test-suite/tests/valid/example-bom.toml +++ /dev/null @@ -1,5 +0,0 @@ -best-day-ever = 1987-07-05T17:45:00Z - -[numtheory] -boring = false -perfection = [6, 28, 496] diff --git a/test-suite/tests/valid/example-v0.3.0.milf b/test-suite/tests/valid/example-v0.3.0.milf new file mode 100644 index 0000000..dff4c8a --- /dev/null +++ b/test-suite/tests/valid/example-v0.3.0.milf @@ -0,0 +1,182 @@ +# Comment +# I am a comment. Hear me roar. Roar. + +# Table +# Tables (also known as hash tables or dictionaries) are collections of key/value pairs. +# They appear in square brackets on a line by themselves. + +[Table] + +key = "value" # Yeah, you can do this. + +# Nested tables are denoted by table names with dots in them. Name your tables whatever crap you please, just don't use #, ., [ or ]. + +[dog.tater] +type = "pug" + +# You don't need to specify all the super-tables if you don't want to. MILF knows how to do it for you. + +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work + +# String +# There are four ways to express strings: basic, multi-line basic, literal, and multi-line literal. +# All strings must contain only valid UTF-8 characters. + +[String] +basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + +[String.Multiline] + +# The following strings are byte-for-byte equivalent: +key1 = "One\nTwo" +key2 = """One\nTwo""" +key3 = """ +One +Two""" + +[String.Multilined.Singleline] + +# The following strings are byte-for-byte equivalent: +key1 = "The quick brown fox jumps over the lazy dog." + +key2 = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +key3 = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +[String.Literal] + +# What you see is what you get. +winpath = 'C:\Users\nodejs\templates' +winpath2 = '\\ServerX\admin$\system32\' +quoted = 'Tom "Dubs" Preston-Werner' +regex = '<\i\c*\s*>' + + +[String.Literal.Multiline] + +regex2 = '''I [dw]on't need \d{2} apples''' +lines = ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' + +# Integer +# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. +# Negative numbers are prefixed with a minus sign. + +[Integer] +key1 = +99 +key2 = 42 +key3 = 0 +key4 = -17 + +# Float +# A float consists of an integer part (which may be prefixed with a plus or minus sign) +# followed by a fractional part and/or an exponent part. + +[Float.fractional] + +# fractional +key1 = +1.0 +key2 = 3.1415 +key3 = -0.01 + +[Float.exponent] + +# exponent +#key1 = 5e+22 +#key2 = 1e6 +#key3 = -2E-2 + +[Float.both] + +# both +#key = 6.626e-34 + +# Boolean +# Booleans are just the tokens you're used to. Always lowercase. + +[Booleans] +True = true +False = false + +# Datetime +# Datetimes are RFC 3339 dates. + +[Datetime] +key1 = 1979-05-27T07:32:00Z +#key2 = 1979-05-27T00:32:00-07:00 +#key3 = 1979-05-27T00:32:00.999999-07:00 + +# Array +# Arrays are square brackets with other primitives inside. Whitespace is ignored. Elements are separated by commas. Data types may not be mixed. + +[Array] +key1 = [ 1, 2, 3 ] +key2 = [ "red", "yellow", "green" ] +key3 = [ [ 1, 2 ], [3, 4, 5] ] +key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok + +#Arrays can also be multiline. So in addition to ignoring whitespace, arrays also ignore newlines between the brackets. +# Terminating commas are ok before the closing bracket. + +key5 = [ + 1, 2, 3 +] +key6 = [ + 1, + 2, # this is ok +] + +# Array of Tables +# These can be expressed by using a table name in double brackets. +# Each table with the same double bracketed name will be an element in the array. +# The tables are inserted in the order encountered. + +[[products]] +name = "Hammer" +sku = 738594937 + +[[products]] + +[[products]] +name = "Nail" +sku = 284758393 +color = "gray" + + +# You can create nested arrays of tables as well. + +[[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + +[[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" + diff --git a/test-suite/tests/valid/example-v0.3.0.toml b/test-suite/tests/valid/example-v0.3.0.toml deleted file mode 100644 index 76aacc3..0000000 --- a/test-suite/tests/valid/example-v0.3.0.toml +++ /dev/null @@ -1,182 +0,0 @@ -# Comment -# I am a comment. Hear me roar. Roar. - -# Table -# Tables (also known as hash tables or dictionaries) are collections of key/value pairs. -# They appear in square brackets on a line by themselves. - -[Table] - -key = "value" # Yeah, you can do this. - -# Nested tables are denoted by table names with dots in them. Name your tables whatever crap you please, just don't use #, ., [ or ]. - -[dog.tater] -type = "pug" - -# You don't need to specify all the super-tables if you don't want to. TOML knows how to do it for you. - -# [x] you -# [x.y] don't -# [x.y.z] need these -[x.y.z.w] # for this to work - -# String -# There are four ways to express strings: basic, multi-line basic, literal, and multi-line literal. -# All strings must contain only valid UTF-8 characters. - -[String] -basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." - -[String.Multiline] - -# The following strings are byte-for-byte equivalent: -key1 = "One\nTwo" -key2 = """One\nTwo""" -key3 = """ -One -Two""" - -[String.Multilined.Singleline] - -# The following strings are byte-for-byte equivalent: -key1 = "The quick brown fox jumps over the lazy dog." - -key2 = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" - -key3 = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ - -[String.Literal] - -# What you see is what you get. -winpath = 'C:\Users\nodejs\templates' -winpath2 = '\\ServerX\admin$\system32\' -quoted = 'Tom "Dubs" Preston-Werner' -regex = '<\i\c*\s*>' - - -[String.Literal.Multiline] - -regex2 = '''I [dw]on't need \d{2} apples''' -lines = ''' -The first newline is -trimmed in raw strings. - All other whitespace - is preserved. -''' - -# Integer -# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. -# Negative numbers are prefixed with a minus sign. - -[Integer] -key1 = +99 -key2 = 42 -key3 = 0 -key4 = -17 - -# Float -# A float consists of an integer part (which may be prefixed with a plus or minus sign) -# followed by a fractional part and/or an exponent part. - -[Float.fractional] - -# fractional -key1 = +1.0 -key2 = 3.1415 -key3 = -0.01 - -[Float.exponent] - -# exponent -#key1 = 5e+22 -#key2 = 1e6 -#key3 = -2E-2 - -[Float.both] - -# both -#key = 6.626e-34 - -# Boolean -# Booleans are just the tokens you're used to. Always lowercase. - -[Booleans] -True = true -False = false - -# Datetime -# Datetimes are RFC 3339 dates. - -[Datetime] -key1 = 1979-05-27T07:32:00Z -#key2 = 1979-05-27T00:32:00-07:00 -#key3 = 1979-05-27T00:32:00.999999-07:00 - -# Array -# Arrays are square brackets with other primitives inside. Whitespace is ignored. Elements are separated by commas. Data types may not be mixed. - -[Array] -key1 = [ 1, 2, 3 ] -key2 = [ "red", "yellow", "green" ] -key3 = [ [ 1, 2 ], [3, 4, 5] ] -key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok - -#Arrays can also be multiline. So in addition to ignoring whitespace, arrays also ignore newlines between the brackets. -# Terminating commas are ok before the closing bracket. - -key5 = [ - 1, 2, 3 -] -key6 = [ - 1, - 2, # this is ok -] - -# Array of Tables -# These can be expressed by using a table name in double brackets. -# Each table with the same double bracketed name will be an element in the array. -# The tables are inserted in the order encountered. - -[[products]] -name = "Hammer" -sku = 738594937 - -[[products]] - -[[products]] -name = "Nail" -sku = 284758393 -color = "gray" - - -# You can create nested arrays of tables as well. - -[[fruit]] - name = "apple" - - [fruit.physical] - color = "red" - shape = "round" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" - -[[fruit]] - name = "banana" - - [[fruit.variety]] - name = "plantain" - diff --git a/test-suite/tests/valid/example-v0.4.0.milf b/test-suite/tests/valid/example-v0.4.0.milf new file mode 100644 index 0000000..061e3c8 --- /dev/null +++ b/test-suite/tests/valid/example-v0.4.0.milf @@ -0,0 +1,236 @@ +################################################################################ +## Comment + +# Speak your mind with the hash symbol. They go from the symbol to the end of +# the line. + + +################################################################################ +## Table + +# Tables (also known as hash tables or dictionaries) are collections of +# key/value pairs. They appear in square brackets on a line by themselves. + +[table] + +key = "value" # Yeah, you can do this. + +# Nested tables are denoted by table names with dots in them. Name your tables +# whatever crap you please, just don't use #, ., [ or ]. + +[table.subtable] + +key = "another value" + +# You don't need to specify all the super-tables if you don't want to. MILF +# knows how to do it for you. + +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work + + +################################################################################ +## Inline Table + +# Inline tables provide a more compact syntax for expressing tables. They are +# especially useful for grouped data that can otherwise quickly become verbose. +# Inline tables are enclosed in curly braces `{` and `}`. No newlines are +# allowed between the curly braces unless they are valid within a value. + +[table.inline] + +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } + + +################################################################################ +## String + +# There are four ways to express strings: basic, multi-line basic, literal, and +# multi-line literal. All strings must contain only valid UTF-8 characters. + +[string.basic] + +basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + +[string.multiline] + +# The following strings are byte-for-byte equivalent: +key1 = "One\nTwo" +key2 = """One\nTwo""" +key3 = """ +One +Two""" + +[string.multiline.continued] + +# The following strings are byte-for-byte equivalent: +key1 = "The quick brown fox jumps over the lazy dog." + +key2 = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +key3 = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +[string.literal] + +# What you see is what you get. +winpath = 'C:\Users\nodejs\templates' +winpath2 = '\\ServerX\admin$\system32\' +quoted = 'Tom "Dubs" Preston-Werner' +regex = '<\i\c*\s*>' + + +[string.literal.multiline] + +regex2 = '''I [dw]on't need \d{2} apples''' +lines = ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' + + +################################################################################ +## Integer + +# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. +# Negative numbers are prefixed with a minus sign. + +[integer] + +key1 = +99 +key2 = 42 +key3 = 0 +key4 = -17 + +[integer.underscores] + +# For large numbers, you may use underscores to enhance readability. Each +# underscore must be surrounded by at least one digit. +key1 = 1_000 +key2 = 5_349_221 +key3 = 1_2_3_4_5 # valid but inadvisable + + +################################################################################ +## Float + +# A float consists of an integer part (which may be prefixed with a plus or +# minus sign) followed by a fractional part and/or an exponent part. + +[float.fractional] + +key1 = +1.0 +key2 = 3.1415 +key3 = -0.01 + +[float.exponent] + +[float.both] + +[float.underscores] + + +################################################################################ +## Boolean + +# Booleans are just the tokens you're used to. Always lowercase. + +[boolean] + +True = true +False = false + + +################################################################################ +## Datetime + +# Datetimes are RFC 3339 dates. + +[datetime] + +#key1 = 1979-05-27T07:32:00Z +#key2 = 1979-05-27T00:32:00-07:00 +#key3 = 1979-05-27T00:32:00.999999-07:00 + + +################################################################################ +## Array + +# Arrays are square brackets with other primitives inside. Whitespace is +# ignored. Elements are separated by commas. Since 2019-11-06 data types can be +# mixed. + +[array] + +key1 = [ 1, 2, 3 ] +key2 = [ "red", "yellow", "green" ] +key3 = [ [ 1, 2 ], [3, 4, 5] ] +key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok + +# Arrays can also be multiline. So in addition to ignoring whitespace, arrays +# also ignore newlines between the brackets. Terminating commas are ok before +# the closing bracket. + +key5 = [ + 1, 2, 3 +] +key6 = [ + 1, + 2, # this is ok +] + + +################################################################################ +## Array of Tables + +# These can be expressed by using a table name in double brackets. Each table +# with the same double bracketed name will be an element in the array. The +# tables are inserted in the order encountered. + +[[products]] + +name = "Hammer" +sku = 738594937 + +[[products]] + +[[products]] + +name = "Nail" +sku = 284758393 +color = "gray" + + +# You can create nested arrays of tables as well. + +[[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + +[[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" diff --git a/test-suite/tests/valid/example-v0.4.0.toml b/test-suite/tests/valid/example-v0.4.0.toml deleted file mode 100644 index 69f1c1b..0000000 --- a/test-suite/tests/valid/example-v0.4.0.toml +++ /dev/null @@ -1,236 +0,0 @@ -################################################################################ -## Comment - -# Speak your mind with the hash symbol. They go from the symbol to the end of -# the line. - - -################################################################################ -## Table - -# Tables (also known as hash tables or dictionaries) are collections of -# key/value pairs. They appear in square brackets on a line by themselves. - -[table] - -key = "value" # Yeah, you can do this. - -# Nested tables are denoted by table names with dots in them. Name your tables -# whatever crap you please, just don't use #, ., [ or ]. - -[table.subtable] - -key = "another value" - -# You don't need to specify all the super-tables if you don't want to. TOML -# knows how to do it for you. - -# [x] you -# [x.y] don't -# [x.y.z] need these -[x.y.z.w] # for this to work - - -################################################################################ -## Inline Table - -# Inline tables provide a more compact syntax for expressing tables. They are -# especially useful for grouped data that can otherwise quickly become verbose. -# Inline tables are enclosed in curly braces `{` and `}`. No newlines are -# allowed between the curly braces unless they are valid within a value. - -[table.inline] - -name = { first = "Tom", last = "Preston-Werner" } -point = { x = 1, y = 2 } - - -################################################################################ -## String - -# There are four ways to express strings: basic, multi-line basic, literal, and -# multi-line literal. All strings must contain only valid UTF-8 characters. - -[string.basic] - -basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." - -[string.multiline] - -# The following strings are byte-for-byte equivalent: -key1 = "One\nTwo" -key2 = """One\nTwo""" -key3 = """ -One -Two""" - -[string.multiline.continued] - -# The following strings are byte-for-byte equivalent: -key1 = "The quick brown fox jumps over the lazy dog." - -key2 = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" - -key3 = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ - -[string.literal] - -# What you see is what you get. -winpath = 'C:\Users\nodejs\templates' -winpath2 = '\\ServerX\admin$\system32\' -quoted = 'Tom "Dubs" Preston-Werner' -regex = '<\i\c*\s*>' - - -[string.literal.multiline] - -regex2 = '''I [dw]on't need \d{2} apples''' -lines = ''' -The first newline is -trimmed in raw strings. - All other whitespace - is preserved. -''' - - -################################################################################ -## Integer - -# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. -# Negative numbers are prefixed with a minus sign. - -[integer] - -key1 = +99 -key2 = 42 -key3 = 0 -key4 = -17 - -[integer.underscores] - -# For large numbers, you may use underscores to enhance readability. Each -# underscore must be surrounded by at least one digit. -key1 = 1_000 -key2 = 5_349_221 -key3 = 1_2_3_4_5 # valid but inadvisable - - -################################################################################ -## Float - -# A float consists of an integer part (which may be prefixed with a plus or -# minus sign) followed by a fractional part and/or an exponent part. - -[float.fractional] - -key1 = +1.0 -key2 = 3.1415 -key3 = -0.01 - -[float.exponent] - -[float.both] - -[float.underscores] - - -################################################################################ -## Boolean - -# Booleans are just the tokens you're used to. Always lowercase. - -[boolean] - -True = true -False = false - - -################################################################################ -## Datetime - -# Datetimes are RFC 3339 dates. - -[datetime] - -#key1 = 1979-05-27T07:32:00Z -#key2 = 1979-05-27T00:32:00-07:00 -#key3 = 1979-05-27T00:32:00.999999-07:00 - - -################################################################################ -## Array - -# Arrays are square brackets with other primitives inside. Whitespace is -# ignored. Elements are separated by commas. Since 2019-11-06 data types can be -# mixed. - -[array] - -key1 = [ 1, 2, 3 ] -key2 = [ "red", "yellow", "green" ] -key3 = [ [ 1, 2 ], [3, 4, 5] ] -key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok - -# Arrays can also be multiline. So in addition to ignoring whitespace, arrays -# also ignore newlines between the brackets. Terminating commas are ok before -# the closing bracket. - -key5 = [ - 1, 2, 3 -] -key6 = [ - 1, - 2, # this is ok -] - - -################################################################################ -## Array of Tables - -# These can be expressed by using a table name in double brackets. Each table -# with the same double bracketed name will be an element in the array. The -# tables are inserted in the order encountered. - -[[products]] - -name = "Hammer" -sku = 738594937 - -[[products]] - -[[products]] - -name = "Nail" -sku = 284758393 -color = "gray" - - -# You can create nested arrays of tables as well. - -[[fruit]] - name = "apple" - - [fruit.physical] - color = "red" - shape = "round" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" - -[[fruit]] - name = "banana" - - [[fruit.variety]] - name = "plantain" diff --git a/test-suite/tests/valid/example.milf b/test-suite/tests/valid/example.milf new file mode 100644 index 0000000..8cb02e0 --- /dev/null +++ b/test-suite/tests/valid/example.milf @@ -0,0 +1,5 @@ +best-day-ever = 1987-07-05T17:45:00Z + +[numtheory] +boring = false +perfection = [6, 28, 496] diff --git a/test-suite/tests/valid/example.toml b/test-suite/tests/valid/example.toml deleted file mode 100644 index 8cb02e0..0000000 --- a/test-suite/tests/valid/example.toml +++ /dev/null @@ -1,5 +0,0 @@ -best-day-ever = 1987-07-05T17:45:00Z - -[numtheory] -boring = false -perfection = [6, 28, 496] diff --git a/test-suite/tests/valid/example2.json b/test-suite/tests/valid/example2.json index 3249a97..5471d7f 100644 --- a/test-suite/tests/valid/example2.json +++ b/test-suite/tests/valid/example2.json @@ -1 +1 @@ -{"clients":{"data":{"type":"array","value":[{"type":"array","value":[{"type":"string","value":"gamma"},{"type":"string","value":"delta"}]},{"type":"array","value":[{"type":"integer","value":"1"},{"type":"integer","value":"2"}]}]},"hosts":{"type":"array","value":[{"type":"string","value":"alpha"},{"type":"string","value":"omega"}]}},"database":{"connection_max":{"type":"integer","value":"5000"},"enabled":{"type":"bool","value":"true"},"ports":{"type":"array","value":[{"type":"integer","value":"8001"},{"type":"integer","value":"8001"},{"type":"integer","value":"8002"}]},"server":{"type":"string","value":"192.168.1.1"}},"owner":{"bio":{"type":"string","value":"GitHub Cofounder \u0026 CEO\nLikes tater tots and beer."},"dob":{"type":"datetime","value":"1979-05-27T07:32:00Z"},"name":{"type":"string","value":"Tom Preston-Werner"},"organization":{"type":"string","value":"GitHub"}},"products":[{"name":{"type":"string","value":"Hammer"},"sku":{"type":"integer","value":"738594937"}},{"color":{"type":"string","value":"gray"},"name":{"type":"string","value":"Nail"},"sku":{"type":"integer","value":"284758393"}}],"servers":{"alpha":{"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.1"}},"beta":{"country":{"type":"string","value":"中国"},"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.2"}}},"title":{"type":"string","value":"TOML Example"}} +{"clients":{"data":{"type":"array","value":[{"type":"array","value":[{"type":"string","value":"gamma"},{"type":"string","value":"delta"}]},{"type":"array","value":[{"type":"integer","value":"1"},{"type":"integer","value":"2"}]}]},"hosts":{"type":"array","value":[{"type":"string","value":"alpha"},{"type":"string","value":"omega"}]}},"database":{"connection_max":{"type":"integer","value":"5000"},"enabled":{"type":"bool","value":"true"},"ports":{"type":"array","value":[{"type":"integer","value":"8001"},{"type":"integer","value":"8001"},{"type":"integer","value":"8002"}]},"server":{"type":"string","value":"192.168.1.1"}},"owner":{"bio":{"type":"string","value":"GitHub Cofounder \u0026 CEO\nLikes tater tots and beer."},"dob":{"type":"datetime","value":"1979-05-27T07:32:00Z"},"name":{"type":"string","value":"Tom Preston-Werner"},"organization":{"type":"string","value":"GitHub"}},"products":[{"name":{"type":"string","value":"Hammer"},"sku":{"type":"integer","value":"738594937"}},{"color":{"type":"string","value":"gray"},"name":{"type":"string","value":"Nail"},"sku":{"type":"integer","value":"284758393"}}],"servers":{"alpha":{"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.1"}},"beta":{"country":{"type":"string","value":"中国"},"dc":{"type":"string","value":"eqdc10"},"ip":{"type":"string","value":"10.0.0.2"}}},"title":{"type":"string","value":"MILF Example"}} diff --git a/test-suite/tests/valid/example2.milf b/test-suite/tests/valid/example2.milf new file mode 100644 index 0000000..75b138c --- /dev/null +++ b/test-suite/tests/valid/example2.milf @@ -0,0 +1,47 @@ +# This is a MILF document. Boom. + +title = "MILF Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. MILF don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + country = "中国" # This should be parsed as UTF-8 + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it + +# Line breaks are OK when inside arrays +hosts = [ + "alpha", + "omega" +] + +# Products + + [[products]] + name = "Hammer" + sku = 738594937 + + [[products]] + name = "Nail" + sku = 284758393 + color = "gray" diff --git a/test-suite/tests/valid/example2.toml b/test-suite/tests/valid/example2.toml deleted file mode 100644 index bc12c99..0000000 --- a/test-suite/tests/valid/example2.toml +++ /dev/null @@ -1,47 +0,0 @@ -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - country = "中国" # This should be parsed as UTF-8 - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] - -# Products - - [[products]] - name = "Hammer" - sku = 738594937 - - [[products]] - name = "Nail" - sku = 284758393 - color = "gray" diff --git a/test-suite/tests/valid/float-exponent.milf b/test-suite/tests/valid/float-exponent.milf new file mode 100644 index 0000000..5349db3 --- /dev/null +++ b/test-suite/tests/valid/float-exponent.milf @@ -0,0 +1,9 @@ +lower = 3e2 +upper = 3E2 +neg = 3e-2 +pos = 3E+2 +zero = 3e0 +pointlower = 3.1e2 +pointupper = 3.1E2 +prefix-zero-exp = 1e06 +prefix-zero-exp-plus = 1e+06 diff --git a/test-suite/tests/valid/float-exponent.toml b/test-suite/tests/valid/float-exponent.toml deleted file mode 100644 index 5349db3..0000000 --- a/test-suite/tests/valid/float-exponent.toml +++ /dev/null @@ -1,9 +0,0 @@ -lower = 3e2 -upper = 3E2 -neg = 3e-2 -pos = 3E+2 -zero = 3e0 -pointlower = 3.1e2 -pointupper = 3.1E2 -prefix-zero-exp = 1e06 -prefix-zero-exp-plus = 1e+06 diff --git a/test-suite/tests/valid/float.milf b/test-suite/tests/valid/float.milf new file mode 100644 index 0000000..7c528d2 --- /dev/null +++ b/test-suite/tests/valid/float.milf @@ -0,0 +1,2 @@ +pi = 3.14 +negpi = -3.14 diff --git a/test-suite/tests/valid/float.toml b/test-suite/tests/valid/float.toml deleted file mode 100644 index 7c528d2..0000000 --- a/test-suite/tests/valid/float.toml +++ /dev/null @@ -1,2 +0,0 @@ -pi = 3.14 -negpi = -3.14 diff --git a/test-suite/tests/valid/hard_example.milf b/test-suite/tests/valid/hard_example.milf new file mode 100644 index 0000000..d2181ec --- /dev/null +++ b/test-suite/tests/valid/hard_example.milf @@ -0,0 +1,33 @@ +# Test file for MILF +# Only this one tries to emulate a MILF file written by a user of the kind of parser writers probably hate +# This part you'll really hate + +[the] +test_string = "You'll hate me after this - #" # " Annoying, isn't it? + + [the.hard] + test_array = [ "] ", " # "] # ] There you go, parse this! + test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ] + # You didn't think it'd as easy as chucking out the last #, did you? + another_test_string = " Same thing, but with a string #" + harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" + # Things will get harder + + [the.hard."bit#"] + "what?" = "You don't think some user won't do that?" + multi_line_array = [ + "]", + # ] Oh yes I did + ] + +# Each of the following keygroups/key value pairs should produce an error. Uncomment to them to test + +#[error] if you didn't catch this, your parser is broken +#string = "Anything other than tabs, spaces and newline after a keygroup or key value pair has ended should produce an error unless it is a comment" like this +#array = [ +# "This might most likely happen in multiline arrays", +# Like here, +# "or here, +# and here" +# ] End of array comment, forgot the # +#number = 3.14 pi <--again forgot the # diff --git a/test-suite/tests/valid/hard_example.toml b/test-suite/tests/valid/hard_example.toml deleted file mode 100644 index 38856c8..0000000 --- a/test-suite/tests/valid/hard_example.toml +++ /dev/null @@ -1,33 +0,0 @@ -# Test file for TOML -# Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate -# This part you'll really hate - -[the] -test_string = "You'll hate me after this - #" # " Annoying, isn't it? - - [the.hard] - test_array = [ "] ", " # "] # ] There you go, parse this! - test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ] - # You didn't think it'd as easy as chucking out the last #, did you? - another_test_string = " Same thing, but with a string #" - harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" - # Things will get harder - - [the.hard."bit#"] - "what?" = "You don't think some user won't do that?" - multi_line_array = [ - "]", - # ] Oh yes I did - ] - -# Each of the following keygroups/key value pairs should produce an error. Uncomment to them to test - -#[error] if you didn't catch this, your parser is broken -#string = "Anything other than tabs, spaces and newline after a keygroup or key value pair has ended should produce an error unless it is a comment" like this -#array = [ -# "This might most likely happen in multiline arrays", -# Like here, -# "or here, -# and here" -# ] End of array comment, forgot the # -#number = 3.14 pi <--again forgot the # diff --git a/test-suite/tests/valid/implicit-and-explicit-after.milf b/test-suite/tests/valid/implicit-and-explicit-after.milf new file mode 100644 index 0000000..c0e8865 --- /dev/null +++ b/test-suite/tests/valid/implicit-and-explicit-after.milf @@ -0,0 +1,5 @@ +[a.b.c] +answer = 42 + +[a] +better = 43 diff --git a/test-suite/tests/valid/implicit-and-explicit-after.toml b/test-suite/tests/valid/implicit-and-explicit-after.toml deleted file mode 100644 index c0e8865..0000000 --- a/test-suite/tests/valid/implicit-and-explicit-after.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a.b.c] -answer = 42 - -[a] -better = 43 diff --git a/test-suite/tests/valid/implicit-and-explicit-before.milf b/test-suite/tests/valid/implicit-and-explicit-before.milf new file mode 100644 index 0000000..eee68ff --- /dev/null +++ b/test-suite/tests/valid/implicit-and-explicit-before.milf @@ -0,0 +1,5 @@ +[a] +better = 43 + +[a.b.c] +answer = 42 diff --git a/test-suite/tests/valid/implicit-and-explicit-before.toml b/test-suite/tests/valid/implicit-and-explicit-before.toml deleted file mode 100644 index eee68ff..0000000 --- a/test-suite/tests/valid/implicit-and-explicit-before.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a] -better = 43 - -[a.b.c] -answer = 42 diff --git a/test-suite/tests/valid/implicit-groups.milf b/test-suite/tests/valid/implicit-groups.milf new file mode 100644 index 0000000..b6333e4 --- /dev/null +++ b/test-suite/tests/valid/implicit-groups.milf @@ -0,0 +1,2 @@ +[a.b.c] +answer = 42 diff --git a/test-suite/tests/valid/implicit-groups.toml b/test-suite/tests/valid/implicit-groups.toml deleted file mode 100644 index b6333e4..0000000 --- a/test-suite/tests/valid/implicit-groups.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a.b.c] -answer = 42 diff --git a/test-suite/tests/valid/integer.milf b/test-suite/tests/valid/integer.milf new file mode 100644 index 0000000..8362459 --- /dev/null +++ b/test-suite/tests/valid/integer.milf @@ -0,0 +1,18 @@ +answer = 42 +neganswer = -42 + +neg_zero = -0 +pos_zero = +0 + +# hexadecimal with prefix `0x` +hex1 = 0xDEADBEEF +hex2 = 0xdeadbeef +hex3 = 0xdead_beef + +# octal with prefix `0o` +oct1 = 0o01234567 +oct2 = 0o755 # useful for Unix file permissions + +# binary with prefix `0b` +bin1 = 0b11010110 + diff --git a/test-suite/tests/valid/integer.toml b/test-suite/tests/valid/integer.toml deleted file mode 100644 index 8362459..0000000 --- a/test-suite/tests/valid/integer.toml +++ /dev/null @@ -1,18 +0,0 @@ -answer = 42 -neganswer = -42 - -neg_zero = -0 -pos_zero = +0 - -# hexadecimal with prefix `0x` -hex1 = 0xDEADBEEF -hex2 = 0xdeadbeef -hex3 = 0xdead_beef - -# octal with prefix `0o` -oct1 = 0o01234567 -oct2 = 0o755 # useful for Unix file permissions - -# binary with prefix `0b` -bin1 = 0b11010110 - diff --git a/test-suite/tests/valid/key-equals-nospace.milf b/test-suite/tests/valid/key-equals-nospace.milf new file mode 100644 index 0000000..560901c --- /dev/null +++ b/test-suite/tests/valid/key-equals-nospace.milf @@ -0,0 +1 @@ +answer=42 diff --git a/test-suite/tests/valid/key-equals-nospace.toml b/test-suite/tests/valid/key-equals-nospace.toml deleted file mode 100644 index 560901c..0000000 --- a/test-suite/tests/valid/key-equals-nospace.toml +++ /dev/null @@ -1 +0,0 @@ -answer=42 diff --git a/test-suite/tests/valid/key-quote-newline.milf b/test-suite/tests/valid/key-quote-newline.milf new file mode 100644 index 0000000..a2639bf --- /dev/null +++ b/test-suite/tests/valid/key-quote-newline.milf @@ -0,0 +1 @@ +"\n" = 1 diff --git a/test-suite/tests/valid/key-quote-newline.toml b/test-suite/tests/valid/key-quote-newline.toml deleted file mode 100644 index a2639bf..0000000 --- a/test-suite/tests/valid/key-quote-newline.toml +++ /dev/null @@ -1 +0,0 @@ -"\n" = 1 diff --git a/test-suite/tests/valid/key-space.milf b/test-suite/tests/valid/key-space.milf new file mode 100644 index 0000000..f4f36c4 --- /dev/null +++ b/test-suite/tests/valid/key-space.milf @@ -0,0 +1 @@ +"a b" = 1 diff --git a/test-suite/tests/valid/key-space.toml b/test-suite/tests/valid/key-space.toml deleted file mode 100644 index f4f36c4..0000000 --- a/test-suite/tests/valid/key-space.toml +++ /dev/null @@ -1 +0,0 @@ -"a b" = 1 diff --git a/test-suite/tests/valid/key-special-chars.milf b/test-suite/tests/valid/key-special-chars.milf new file mode 100644 index 0000000..dc43625 --- /dev/null +++ b/test-suite/tests/valid/key-special-chars.milf @@ -0,0 +1 @@ +"~!@#$^&*()_+-`1234567890[]\\|/?><.,;:'" = 1 diff --git a/test-suite/tests/valid/key-special-chars.toml b/test-suite/tests/valid/key-special-chars.toml deleted file mode 100644 index dc43625..0000000 --- a/test-suite/tests/valid/key-special-chars.toml +++ /dev/null @@ -1 +0,0 @@ -"~!@#$^&*()_+-`1234567890[]\\|/?><.,;:'" = 1 diff --git a/test-suite/tests/valid/key-with-pound.milf b/test-suite/tests/valid/key-with-pound.milf new file mode 100644 index 0000000..65b766f --- /dev/null +++ b/test-suite/tests/valid/key-with-pound.milf @@ -0,0 +1 @@ +"key#name" = 5 diff --git a/test-suite/tests/valid/key-with-pound.toml b/test-suite/tests/valid/key-with-pound.toml deleted file mode 100644 index 65b766f..0000000 --- a/test-suite/tests/valid/key-with-pound.toml +++ /dev/null @@ -1 +0,0 @@ -"key#name" = 5 diff --git a/test-suite/tests/valid/long-float.milf b/test-suite/tests/valid/long-float.milf new file mode 100644 index 0000000..9558ae4 --- /dev/null +++ b/test-suite/tests/valid/long-float.milf @@ -0,0 +1,2 @@ +longpi = 3.141592653589793 +neglongpi = -3.141592653589793 diff --git a/test-suite/tests/valid/long-float.toml b/test-suite/tests/valid/long-float.toml deleted file mode 100644 index 9558ae4..0000000 --- a/test-suite/tests/valid/long-float.toml +++ /dev/null @@ -1,2 +0,0 @@ -longpi = 3.141592653589793 -neglongpi = -3.141592653589793 diff --git a/test-suite/tests/valid/long-integer.milf b/test-suite/tests/valid/long-integer.milf new file mode 100644 index 0000000..424a13a --- /dev/null +++ b/test-suite/tests/valid/long-integer.milf @@ -0,0 +1,2 @@ +answer = 9223372036854775807 +neganswer = -9223372036854775808 diff --git a/test-suite/tests/valid/long-integer.toml b/test-suite/tests/valid/long-integer.toml deleted file mode 100644 index 424a13a..0000000 --- a/test-suite/tests/valid/long-integer.toml +++ /dev/null @@ -1,2 +0,0 @@ -answer = 9223372036854775807 -neganswer = -9223372036854775808 diff --git a/test-suite/tests/valid/multiline-string.milf b/test-suite/tests/valid/multiline-string.milf new file mode 100644 index 0000000..2c4237f --- /dev/null +++ b/test-suite/tests/valid/multiline-string.milf @@ -0,0 +1,34 @@ +multiline_empty_one = """""" +multiline_empty_two = """ +""" +multiline_empty_three = """\ + """ +multiline_empty_four = """\ + \ + \ + """ +multiline_empty_five = """\ + \ + \ + \ + """ + +equivalent_one = "The quick brown fox jumps over the lazy dog." +equivalent_two = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +equivalent_three = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +equivalent_four = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ diff --git a/test-suite/tests/valid/multiline-string.toml b/test-suite/tests/valid/multiline-string.toml deleted file mode 100644 index 2c4237f..0000000 --- a/test-suite/tests/valid/multiline-string.toml +++ /dev/null @@ -1,34 +0,0 @@ -multiline_empty_one = """""" -multiline_empty_two = """ -""" -multiline_empty_three = """\ - """ -multiline_empty_four = """\ - \ - \ - """ -multiline_empty_five = """\ - \ - \ - \ - """ - -equivalent_one = "The quick brown fox jumps over the lazy dog." -equivalent_two = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" - -equivalent_three = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ - -equivalent_four = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ diff --git a/test-suite/tests/valid/quote-surrounded-value.milf b/test-suite/tests/valid/quote-surrounded-value.milf new file mode 100644 index 0000000..dc8697e --- /dev/null +++ b/test-suite/tests/valid/quote-surrounded-value.milf @@ -0,0 +1,2 @@ +double = '"double quotes here"' +single = "'single quotes here'" diff --git a/test-suite/tests/valid/quote-surrounded-value.toml b/test-suite/tests/valid/quote-surrounded-value.toml deleted file mode 100644 index dc8697e..0000000 --- a/test-suite/tests/valid/quote-surrounded-value.toml +++ /dev/null @@ -1,2 +0,0 @@ -double = '"double quotes here"' -single = "'single quotes here'" diff --git a/test-suite/tests/valid/raw-multiline-string.milf b/test-suite/tests/valid/raw-multiline-string.milf new file mode 100644 index 0000000..8094c03 --- /dev/null +++ b/test-suite/tests/valid/raw-multiline-string.milf @@ -0,0 +1,9 @@ +oneline = '''This string has a ' quote character.''' +firstnl = ''' +This string has a ' quote character.''' +multiline = ''' +This string +has ' a quote character +and more than +one newline +in it.''' diff --git a/test-suite/tests/valid/raw-multiline-string.toml b/test-suite/tests/valid/raw-multiline-string.toml deleted file mode 100644 index 8094c03..0000000 --- a/test-suite/tests/valid/raw-multiline-string.toml +++ /dev/null @@ -1,9 +0,0 @@ -oneline = '''This string has a ' quote character.''' -firstnl = ''' -This string has a ' quote character.''' -multiline = ''' -This string -has ' a quote character -and more than -one newline -in it.''' diff --git a/test-suite/tests/valid/raw-string.milf b/test-suite/tests/valid/raw-string.milf new file mode 100644 index 0000000..92acd25 --- /dev/null +++ b/test-suite/tests/valid/raw-string.milf @@ -0,0 +1,7 @@ +backspace = 'This string has a \b backspace character.' +tab = 'This string has a \t tab character.' +newline = 'This string has a \n new line character.' +formfeed = 'This string has a \f form feed character.' +carriage = 'This string has a \r carriage return character.' +slash = 'This string has a \/ slash character.' +backslash = 'This string has a \\ backslash character.' diff --git a/test-suite/tests/valid/raw-string.toml b/test-suite/tests/valid/raw-string.toml deleted file mode 100644 index 92acd25..0000000 --- a/test-suite/tests/valid/raw-string.toml +++ /dev/null @@ -1,7 +0,0 @@ -backspace = 'This string has a \b backspace character.' -tab = 'This string has a \t tab character.' -newline = 'This string has a \n new line character.' -formfeed = 'This string has a \f form feed character.' -carriage = 'This string has a \r carriage return character.' -slash = 'This string has a \/ slash character.' -backslash = 'This string has a \\ backslash character.' diff --git a/test-suite/tests/valid/string-delim-end.milf b/test-suite/tests/valid/string-delim-end.milf new file mode 100644 index 0000000..9a41219 --- /dev/null +++ b/test-suite/tests/valid/string-delim-end.milf @@ -0,0 +1,3 @@ +str1 = """"This," she said, "is just a pointless statement."""" +str2 = '''foo''bar''''' +str3 = """""""" diff --git a/test-suite/tests/valid/string-delim-end.toml b/test-suite/tests/valid/string-delim-end.toml deleted file mode 100644 index 9a41219..0000000 --- a/test-suite/tests/valid/string-delim-end.toml +++ /dev/null @@ -1,3 +0,0 @@ -str1 = """"This," she said, "is just a pointless statement."""" -str2 = '''foo''bar''''' -str3 = """""""" diff --git a/test-suite/tests/valid/string-empty.milf b/test-suite/tests/valid/string-empty.milf new file mode 100644 index 0000000..e37e681 --- /dev/null +++ b/test-suite/tests/valid/string-empty.milf @@ -0,0 +1 @@ +answer = "" diff --git a/test-suite/tests/valid/string-empty.toml b/test-suite/tests/valid/string-empty.toml deleted file mode 100644 index e37e681..0000000 --- a/test-suite/tests/valid/string-empty.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "" diff --git a/test-suite/tests/valid/string-escapes.milf b/test-suite/tests/valid/string-escapes.milf new file mode 100644 index 0000000..152c6ad --- /dev/null +++ b/test-suite/tests/valid/string-escapes.milf @@ -0,0 +1,14 @@ +backspace = "This string has a \b backspace character." +tab = "This string has a \t tab character." +newline = "This string has a \n new line character." +formfeed = "This string has a \f form feed character." +carriage = "This string has a \r carriage return character." +quote = "This string has a \" quote character." +slash = "This string has a / slash character." +backslash = "This string has a \\ backslash character." +notunicode1 = "This string does not have a unicode \\u escape." +notunicode2 = "This string does not have a unicode \u005Cu escape." +notunicode3 = "This string does not have a unicode \\u0075 escape." +notunicode4 = "This string does not have a unicode \\\u0075 escape." +delete = "This string has a \u007F delete control code." +unitseparator = "This string has a \u001F unit separator control code." diff --git a/test-suite/tests/valid/string-escapes.toml b/test-suite/tests/valid/string-escapes.toml deleted file mode 100644 index 152c6ad..0000000 --- a/test-suite/tests/valid/string-escapes.toml +++ /dev/null @@ -1,14 +0,0 @@ -backspace = "This string has a \b backspace character." -tab = "This string has a \t tab character." -newline = "This string has a \n new line character." -formfeed = "This string has a \f form feed character." -carriage = "This string has a \r carriage return character." -quote = "This string has a \" quote character." -slash = "This string has a / slash character." -backslash = "This string has a \\ backslash character." -notunicode1 = "This string does not have a unicode \\u escape." -notunicode2 = "This string does not have a unicode \u005Cu escape." -notunicode3 = "This string does not have a unicode \\u0075 escape." -notunicode4 = "This string does not have a unicode \\\u0075 escape." -delete = "This string has a \u007F delete control code." -unitseparator = "This string has a \u001F unit separator control code." diff --git a/test-suite/tests/valid/string-simple.milf b/test-suite/tests/valid/string-simple.milf new file mode 100644 index 0000000..e17ade6 --- /dev/null +++ b/test-suite/tests/valid/string-simple.milf @@ -0,0 +1 @@ +answer = "You are not drinking enough whisky." diff --git a/test-suite/tests/valid/string-simple.toml b/test-suite/tests/valid/string-simple.toml deleted file mode 100644 index e17ade6..0000000 --- a/test-suite/tests/valid/string-simple.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "You are not drinking enough whisky." diff --git a/test-suite/tests/valid/string-with-pound.milf b/test-suite/tests/valid/string-with-pound.milf new file mode 100644 index 0000000..5fd8746 --- /dev/null +++ b/test-suite/tests/valid/string-with-pound.milf @@ -0,0 +1,2 @@ +pound = "We see no # comments here." +poundcomment = "But there are # some comments here." # Did I # mess you up? diff --git a/test-suite/tests/valid/string-with-pound.toml b/test-suite/tests/valid/string-with-pound.toml deleted file mode 100644 index 5fd8746..0000000 --- a/test-suite/tests/valid/string-with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -pound = "We see no # comments here." -poundcomment = "But there are # some comments here." # Did I # mess you up? diff --git a/test-suite/tests/valid/table-array-implicit.milf b/test-suite/tests/valid/table-array-implicit.milf new file mode 100644 index 0000000..3157ac9 --- /dev/null +++ b/test-suite/tests/valid/table-array-implicit.milf @@ -0,0 +1,2 @@ +[[albums.songs]] +name = "Glory Days" diff --git a/test-suite/tests/valid/table-array-implicit.toml b/test-suite/tests/valid/table-array-implicit.toml deleted file mode 100644 index 3157ac9..0000000 --- a/test-suite/tests/valid/table-array-implicit.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[albums.songs]] -name = "Glory Days" diff --git a/test-suite/tests/valid/table-array-many.milf b/test-suite/tests/valid/table-array-many.milf new file mode 100644 index 0000000..46062be --- /dev/null +++ b/test-suite/tests/valid/table-array-many.milf @@ -0,0 +1,11 @@ +[[people]] +first_name = "Bruce" +last_name = "Springsteen" + +[[people]] +first_name = "Eric" +last_name = "Clapton" + +[[people]] +first_name = "Bob" +last_name = "Seger" diff --git a/test-suite/tests/valid/table-array-many.toml b/test-suite/tests/valid/table-array-many.toml deleted file mode 100644 index 46062be..0000000 --- a/test-suite/tests/valid/table-array-many.toml +++ /dev/null @@ -1,11 +0,0 @@ -[[people]] -first_name = "Bruce" -last_name = "Springsteen" - -[[people]] -first_name = "Eric" -last_name = "Clapton" - -[[people]] -first_name = "Bob" -last_name = "Seger" diff --git a/test-suite/tests/valid/table-array-nest-no-keys.milf b/test-suite/tests/valid/table-array-nest-no-keys.milf new file mode 100644 index 0000000..ad6eb10 --- /dev/null +++ b/test-suite/tests/valid/table-array-nest-no-keys.milf @@ -0,0 +1,6 @@ +[[ albums ]] + [[ albums.songs ]] + [[ albums.songs ]] + +[[ artists ]] + [ artists.home.address ] diff --git a/test-suite/tests/valid/table-array-nest-no-keys.toml b/test-suite/tests/valid/table-array-nest-no-keys.toml deleted file mode 100644 index ad6eb10..0000000 --- a/test-suite/tests/valid/table-array-nest-no-keys.toml +++ /dev/null @@ -1,6 +0,0 @@ -[[ albums ]] - [[ albums.songs ]] - [[ albums.songs ]] - -[[ artists ]] - [ artists.home.address ] diff --git a/test-suite/tests/valid/table-array-nest.milf b/test-suite/tests/valid/table-array-nest.milf new file mode 100644 index 0000000..d659a3d --- /dev/null +++ b/test-suite/tests/valid/table-array-nest.milf @@ -0,0 +1,17 @@ +[[albums]] +name = "Born to Run" + + [[albums.songs]] + name = "Jungleland" + + [[albums.songs]] + name = "Meeting Across the River" + +[[albums]] +name = "Born in the USA" + + [[albums.songs]] + name = "Glory Days" + + [[albums.songs]] + name = "Dancing in the Dark" diff --git a/test-suite/tests/valid/table-array-nest.toml b/test-suite/tests/valid/table-array-nest.toml deleted file mode 100644 index d659a3d..0000000 --- a/test-suite/tests/valid/table-array-nest.toml +++ /dev/null @@ -1,17 +0,0 @@ -[[albums]] -name = "Born to Run" - - [[albums.songs]] - name = "Jungleland" - - [[albums.songs]] - name = "Meeting Across the River" - -[[albums]] -name = "Born in the USA" - - [[albums.songs]] - name = "Glory Days" - - [[albums.songs]] - name = "Dancing in the Dark" diff --git a/test-suite/tests/valid/table-array-one.milf b/test-suite/tests/valid/table-array-one.milf new file mode 100644 index 0000000..cd7e1b6 --- /dev/null +++ b/test-suite/tests/valid/table-array-one.milf @@ -0,0 +1,3 @@ +[[people]] +first_name = "Bruce" +last_name = "Springsteen" diff --git a/test-suite/tests/valid/table-array-one.toml b/test-suite/tests/valid/table-array-one.toml deleted file mode 100644 index cd7e1b6..0000000 --- a/test-suite/tests/valid/table-array-one.toml +++ /dev/null @@ -1,3 +0,0 @@ -[[people]] -first_name = "Bruce" -last_name = "Springsteen" diff --git a/test-suite/tests/valid/table-empty.milf b/test-suite/tests/valid/table-empty.milf new file mode 100644 index 0000000..8bb6a0a --- /dev/null +++ b/test-suite/tests/valid/table-empty.milf @@ -0,0 +1 @@ +[a] diff --git a/test-suite/tests/valid/table-empty.toml b/test-suite/tests/valid/table-empty.toml deleted file mode 100644 index 8bb6a0a..0000000 --- a/test-suite/tests/valid/table-empty.toml +++ /dev/null @@ -1 +0,0 @@ -[a] diff --git a/test-suite/tests/valid/table-multi-empty.milf b/test-suite/tests/valid/table-multi-empty.milf new file mode 100644 index 0000000..2266ed2 --- /dev/null +++ b/test-suite/tests/valid/table-multi-empty.milf @@ -0,0 +1,5 @@ +[a] +[a.b] +[b] +[c] +[c.a] diff --git a/test-suite/tests/valid/table-multi-empty.toml b/test-suite/tests/valid/table-multi-empty.toml deleted file mode 100644 index 2266ed2..0000000 --- a/test-suite/tests/valid/table-multi-empty.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a] -[a.b] -[b] -[c] -[c.a] diff --git a/test-suite/tests/valid/table-sub-empty.milf b/test-suite/tests/valid/table-sub-empty.milf new file mode 100644 index 0000000..70b7fe1 --- /dev/null +++ b/test-suite/tests/valid/table-sub-empty.milf @@ -0,0 +1,2 @@ +[a] +[a.b] diff --git a/test-suite/tests/valid/table-sub-empty.toml b/test-suite/tests/valid/table-sub-empty.toml deleted file mode 100644 index 70b7fe1..0000000 --- a/test-suite/tests/valid/table-sub-empty.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a] -[a.b] diff --git a/test-suite/tests/valid/table-whitespace.milf b/test-suite/tests/valid/table-whitespace.milf new file mode 100644 index 0000000..daf881d --- /dev/null +++ b/test-suite/tests/valid/table-whitespace.milf @@ -0,0 +1 @@ +["valid key"] diff --git a/test-suite/tests/valid/table-whitespace.toml b/test-suite/tests/valid/table-whitespace.toml deleted file mode 100644 index daf881d..0000000 --- a/test-suite/tests/valid/table-whitespace.toml +++ /dev/null @@ -1 +0,0 @@ -["valid key"] diff --git a/test-suite/tests/valid/table-with-pound.milf b/test-suite/tests/valid/table-with-pound.milf new file mode 100644 index 0000000..33f2c4f --- /dev/null +++ b/test-suite/tests/valid/table-with-pound.milf @@ -0,0 +1,2 @@ +["key#group"] +answer = 42 diff --git a/test-suite/tests/valid/table-with-pound.toml b/test-suite/tests/valid/table-with-pound.toml deleted file mode 100644 index 33f2c4f..0000000 --- a/test-suite/tests/valid/table-with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -["key#group"] -answer = 42 diff --git a/test-suite/tests/valid/unicode-escape.milf b/test-suite/tests/valid/unicode-escape.milf new file mode 100644 index 0000000..6654252 --- /dev/null +++ b/test-suite/tests/valid/unicode-escape.milf @@ -0,0 +1,6 @@ +answer1 = "\u000B" +answer4 = "\u03B4α" +answer8 = "\U000003B4β" +answer9 = "\uc0de" +answer10 = "\u03b4α" +answer11 = "\U0000abc1" diff --git a/test-suite/tests/valid/unicode-escape.toml b/test-suite/tests/valid/unicode-escape.toml deleted file mode 100644 index 6654252..0000000 --- a/test-suite/tests/valid/unicode-escape.toml +++ /dev/null @@ -1,6 +0,0 @@ -answer1 = "\u000B" -answer4 = "\u03B4α" -answer8 = "\U000003B4β" -answer9 = "\uc0de" -answer10 = "\u03b4α" -answer11 = "\U0000abc1" diff --git a/test-suite/tests/valid/unicode-literal.milf b/test-suite/tests/valid/unicode-literal.milf new file mode 100644 index 0000000..c65723c --- /dev/null +++ b/test-suite/tests/valid/unicode-literal.milf @@ -0,0 +1 @@ +answer = "δ" diff --git a/test-suite/tests/valid/unicode-literal.toml b/test-suite/tests/valid/unicode-literal.toml deleted file mode 100644 index c65723c..0000000 --- a/test-suite/tests/valid/unicode-literal.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "δ" -- cgit v1.2.3