From d2522b47ddf87014ff99d133d5e7c220d4a8894a Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen Date: Sun, 23 May 2021 17:27:13 +0300 Subject: [PATCH] Initial commit --- .bumpversion.cfg | 13 + .flake8 | 6 + .github/workflows/tests.yaml | 85 +++ .gitignore | 135 ++++ .pre-commit-config.yaml | 36 ++ LICENSE | 21 + README.md | 13 + lil_toml/__init__.py | 12 + lil_toml/py.typed | 1 + poetry.lock | 588 ++++++++++++++++++ pyproject.toml | 135 ++++ tests/__init__.py | 0 tests/data/BurntSushi/LICENSE | 22 + tests/data/BurntSushi/README.md | 1 + .../array-mixed-types-arrays-and-ints.toml | 1 + .../array-mixed-types-ints-and-floats.toml | 1 + .../array-mixed-types-strings-and-ints.toml | 1 + .../invalid/bool-wrong-case-false.toml | 1 + .../invalid/bool-wrong-case-true.toml | 1 + .../invalid/datetime-malformed-no-leads.toml | 1 + .../invalid/datetime-malformed-no-secs.toml | 1 + .../invalid/datetime-malformed-no-t.toml | 1 + .../datetime-malformed-with-milli.toml | 1 + .../invalid/duplicate-key-table.toml | 5 + .../BurntSushi/invalid/duplicate-keys.toml | 2 + .../BurntSushi/invalid/duplicate-tables.toml | 2 + .../invalid/empty-implicit-table.toml | 1 + .../data/BurntSushi/invalid/empty-table.toml | 1 + .../invalid/float-leading-zero-neg.toml | 1 + .../invalid/float-leading-zero-pos.toml | 1 + .../invalid/float-leading-zero.toml | 1 + .../invalid/float-no-leading-zero.toml | 2 + .../invalid/float-no-trailing-digits.toml | 2 + .../invalid/float-underscore-after-point.toml | 1 + .../invalid/float-underscore-after.toml | 1 + .../float-underscore-before-point.toml | 1 + .../invalid/float-underscore-before.toml | 1 + .../invalid/inline-table-linebreak.toml | 2 + .../invalid/integer-leading-zero-neg.toml | 1 + .../invalid/integer-leading-zero-pos.toml | 1 + .../invalid/integer-leading-zero.toml | 1 + .../invalid/integer-underscore-after.toml | 1 + .../invalid/integer-underscore-before.toml | 1 + .../invalid/integer-underscore-double.toml | 1 + .../BurntSushi/invalid/key-after-array.toml | 1 + .../BurntSushi/invalid/key-after-table.toml | 1 + tests/data/BurntSushi/invalid/key-empty.toml | 1 + tests/data/BurntSushi/invalid/key-hash.toml | 1 + .../data/BurntSushi/invalid/key-newline.toml | 2 + tests/data/BurntSushi/invalid/key-no-eol.toml | 1 + .../BurntSushi/invalid/key-open-bracket.toml | 1 + .../invalid/key-single-open-bracket.toml | 1 + tests/data/BurntSushi/invalid/key-space.toml | 1 + .../BurntSushi/invalid/key-start-bracket.toml | 3 + .../BurntSushi/invalid/key-two-equals.toml | 1 + tests/data/BurntSushi/invalid/llbrace.toml | 1 + .../invalid/multi-line-inline-table.toml | 4 + .../invalid/multi-line-string-no-close.toml | 2 + tests/data/BurntSushi/invalid/rrbrace.toml | 1 + .../invalid/string-bad-byte-escape.toml | 1 + .../invalid/string-bad-codepoint.toml | 1 + .../BurntSushi/invalid/string-bad-escape.toml | 1 + .../invalid/string-bad-slash-escape.toml | 1 + .../invalid/string-bad-uni-esc.toml | 1 + .../invalid/string-byte-escapes.toml | 1 + .../BurntSushi/invalid/string-no-close.toml | 1 + .../invalid/table-array-implicit.toml | 14 + .../table-array-malformed-bracket.toml | 2 + .../invalid/table-array-malformed-empty.toml | 2 + .../data/BurntSushi/invalid/table-empty.toml | 1 + .../invalid/table-nested-brackets-close.toml | 2 + .../invalid/table-nested-brackets-open.toml | 2 + .../BurntSushi/invalid/table-whitespace.toml | 1 + .../BurntSushi/invalid/table-with-pound.toml | 2 + .../invalid/text-after-array-entries.toml | 4 + .../invalid/text-after-integer.toml | 1 + .../BurntSushi/invalid/text-after-string.toml | 1 + .../BurntSushi/invalid/text-after-table.toml | 1 + .../invalid/text-before-array-separator.toml | 4 + .../BurntSushi/invalid/text-in-array.toml | 5 + tests/data/BurntSushi/valid/array-empty.json | 11 + tests/data/BurntSushi/valid/array-empty.toml | 1 + .../data/BurntSushi/valid/array-nospaces.json | 10 + .../data/BurntSushi/valid/array-nospaces.toml | 1 + .../valid/array-string-quote-comma-2.json | 1 + .../valid/array-string-quote-comma-2.toml | 1 + .../valid/array-string-quote-comma.json | 9 + .../valid/array-string-quote-comma.toml | 4 + .../valid/array-string-with-comma.json | 9 + .../valid/array-string-with-comma.toml | 4 + .../array-table-array-string-backslash.json | 7 + .../array-table-array-string-backslash.toml | 1 + .../BurntSushi/valid/arrays-hetergeneous.json | 19 + .../BurntSushi/valid/arrays-hetergeneous.toml | 1 + .../data/BurntSushi/valid/arrays-nested.json | 13 + .../data/BurntSushi/valid/arrays-nested.toml | 1 + tests/data/BurntSushi/valid/arrays.json | 41 ++ tests/data/BurntSushi/valid/arrays.toml | 12 + tests/data/BurntSushi/valid/bool.json | 4 + tests/data/BurntSushi/valid/bool.toml | 2 + .../BurntSushi/valid/comments-at-eof.json | 3 + .../BurntSushi/valid/comments-at-eof.toml | 2 + .../BurntSushi/valid/comments-at-eof2.json | 3 + .../BurntSushi/valid/comments-at-eof2.toml | 2 + .../BurntSushi/valid/comments-everywhere.json | 12 + .../BurntSushi/valid/comments-everywhere.toml | 24 + .../BurntSushi/valid/datetime-timezone.json | 3 + .../BurntSushi/valid/datetime-timezone.toml | 1 + tests/data/BurntSushi/valid/datetime.json | 5 + tests/data/BurntSushi/valid/datetime.toml | 3 + .../BurntSushi/valid/double-quote-escape.json | 6 + .../BurntSushi/valid/double-quote-escape.toml | 1 + tests/data/BurntSushi/valid/empty.json | 1 + tests/data/BurntSushi/valid/empty.toml | 0 .../data/BurntSushi/valid/escaped-escape.json | 3 + .../data/BurntSushi/valid/escaped-escape.toml | 1 + tests/data/BurntSushi/valid/example.json | 14 + tests/data/BurntSushi/valid/example.toml | 5 + .../BurntSushi/valid/exponent-part-float.json | 6 + .../BurntSushi/valid/exponent-part-float.toml | 3 + .../data/BurntSushi/valid/float-exponent.json | 9 + .../data/BurntSushi/valid/float-exponent.toml | 7 + .../BurntSushi/valid/float-underscore.json | 5 + .../BurntSushi/valid/float-underscore.toml | 3 + tests/data/BurntSushi/valid/float.json | 6 + tests/data/BurntSushi/valid/float.toml | 4 + .../valid/implicit-and-explicit-after.json | 10 + .../valid/implicit-and-explicit-after.toml | 5 + .../valid/implicit-and-explicit-before.json | 10 + .../valid/implicit-and-explicit-before.toml | 5 + .../BurntSushi/valid/implicit-groups.json | 9 + .../BurntSushi/valid/implicit-groups.toml | 2 + .../BurntSushi/valid/inline-table-array.json | 16 + .../BurntSushi/valid/inline-table-array.toml | 3 + tests/data/BurntSushi/valid/inline-table.json | 16 + tests/data/BurntSushi/valid/inline-table.toml | 5 + .../BurntSushi/valid/integer-underscore.json | 3 + .../BurntSushi/valid/integer-underscore.toml | 1 + tests/data/BurntSushi/valid/integer.json | 6 + tests/data/BurntSushi/valid/integer.toml | 4 + .../BurntSushi/valid/key-equals-nospace.json | 3 + .../BurntSushi/valid/key-equals-nospace.toml | 1 + tests/data/BurntSushi/valid/key-numeric.json | 3 + tests/data/BurntSushi/valid/key-numeric.toml | 1 + tests/data/BurntSushi/valid/key-space.json | 3 + tests/data/BurntSushi/valid/key-space.toml | 1 + .../BurntSushi/valid/key-special-chars.json | 5 + .../BurntSushi/valid/key-special-chars.toml | 1 + .../data/BurntSushi/valid/keys-with-dots.json | 14 + .../data/BurntSushi/valid/keys-with-dots.toml | 10 + tests/data/BurntSushi/valid/long-float.json | 4 + tests/data/BurntSushi/valid/long-float.toml | 2 + tests/data/BurntSushi/valid/long-integer.json | 4 + tests/data/BurntSushi/valid/long-integer.toml | 2 + .../BurntSushi/valid/multiline-string.json | 30 + .../BurntSushi/valid/multiline-string.toml | 23 + .../valid/nested-inline-table-array.json | 7 + .../valid/nested-inline-table-array.toml | 1 + tests/data/BurntSushi/valid/newline-crlf.json | 4 + tests/data/BurntSushi/valid/newline-crlf.toml | 2 + tests/data/BurntSushi/valid/newline-lf.json | 4 + tests/data/BurntSushi/valid/newline-lf.toml | 2 + .../valid/raw-multiline-string.json | 14 + .../valid/raw-multiline-string.toml | 9 + tests/data/BurntSushi/valid/raw-string.json | 30 + tests/data/BurntSushi/valid/raw-string.toml | 7 + .../right-curly-brace-after-boolean.json | 16 + .../right-curly-brace-after-boolean.toml | 1 + tests/data/BurntSushi/valid/string-empty.json | 6 + tests/data/BurntSushi/valid/string-empty.toml | 1 + .../data/BurntSushi/valid/string-escapes.json | 46 ++ .../data/BurntSushi/valid/string-escapes.toml | 11 + tests/data/BurntSushi/valid/string-nl.json | 22 + tests/data/BurntSushi/valid/string-nl.toml | 6 + .../data/BurntSushi/valid/string-simple.json | 6 + .../data/BurntSushi/valid/string-simple.toml | 1 + .../BurntSushi/valid/string-with-pound.json | 7 + .../BurntSushi/valid/string-with-pound.toml | 2 + .../valid/table-array-implicit.json | 7 + .../valid/table-array-implicit.toml | 2 + .../BurntSushi/valid/table-array-many.json | 16 + .../BurntSushi/valid/table-array-many.toml | 11 + .../BurntSushi/valid/table-array-nest.json | 18 + .../BurntSushi/valid/table-array-nest.toml | 17 + .../BurntSushi/valid/table-array-one.json | 8 + .../BurntSushi/valid/table-array-one.toml | 3 + .../valid/table-array-table-array.json | 10 + .../valid/table-array-table-array.toml | 7 + tests/data/BurntSushi/valid/table-empty.json | 3 + tests/data/BurntSushi/valid/table-empty.toml | 1 + tests/data/BurntSushi/valid/table-no-eol.json | 1 + tests/data/BurntSushi/valid/table-no-eol.toml | 1 + .../BurntSushi/valid/table-sub-empty.json | 3 + .../BurntSushi/valid/table-sub-empty.toml | 2 + .../BurntSushi/valid/table-whitespace.json | 3 + .../BurntSushi/valid/table-whitespace.toml | 1 + .../valid/table-with-literal-string.json | 9 + .../valid/table-with-literal-string.toml | 4 + .../BurntSushi/valid/table-with-pound.json | 5 + .../BurntSushi/valid/table-with-pound.toml | 2 + .../valid/table-with-single-quotes.json | 9 + .../valid/table-with-single-quotes.toml | 4 + .../BurntSushi/valid/table-without-super.json | 9 + .../BurntSushi/valid/table-without-super.toml | 5 + .../BurntSushi/valid/underscored-float.json | 3 + .../BurntSushi/valid/underscored-float.toml | 1 + .../BurntSushi/valid/underscored-integer.json | 3 + .../BurntSushi/valid/underscored-integer.toml | 1 + .../data/BurntSushi/valid/unicode-escape.json | 4 + .../data/BurntSushi/valid/unicode-escape.toml | 2 + .../BurntSushi/valid/unicode-literal.json | 3 + .../BurntSushi/valid/unicode-literal.toml | 1 + tests/test_fixtures.py | 36 ++ 213 files changed, 2084 insertions(+) create mode 100644 .bumpversion.cfg create mode 100644 .flake8 create mode 100644 .github/workflows/tests.yaml create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 lil_toml/__init__.py create mode 100644 lil_toml/py.typed create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 tests/__init__.py create mode 100644 tests/data/BurntSushi/LICENSE create mode 100644 tests/data/BurntSushi/README.md create mode 100644 tests/data/BurntSushi/invalid/array-mixed-types-arrays-and-ints.toml create mode 100644 tests/data/BurntSushi/invalid/array-mixed-types-ints-and-floats.toml create mode 100644 tests/data/BurntSushi/invalid/array-mixed-types-strings-and-ints.toml create mode 100644 tests/data/BurntSushi/invalid/bool-wrong-case-false.toml create mode 100644 tests/data/BurntSushi/invalid/bool-wrong-case-true.toml create mode 100644 tests/data/BurntSushi/invalid/datetime-malformed-no-leads.toml create mode 100644 tests/data/BurntSushi/invalid/datetime-malformed-no-secs.toml create mode 100644 tests/data/BurntSushi/invalid/datetime-malformed-no-t.toml create mode 100644 tests/data/BurntSushi/invalid/datetime-malformed-with-milli.toml create mode 100644 tests/data/BurntSushi/invalid/duplicate-key-table.toml create mode 100644 tests/data/BurntSushi/invalid/duplicate-keys.toml create mode 100644 tests/data/BurntSushi/invalid/duplicate-tables.toml create mode 100644 tests/data/BurntSushi/invalid/empty-implicit-table.toml create mode 100644 tests/data/BurntSushi/invalid/empty-table.toml create mode 100644 tests/data/BurntSushi/invalid/float-leading-zero-neg.toml create mode 100644 tests/data/BurntSushi/invalid/float-leading-zero-pos.toml create mode 100644 tests/data/BurntSushi/invalid/float-leading-zero.toml create mode 100644 tests/data/BurntSushi/invalid/float-no-leading-zero.toml create mode 100644 tests/data/BurntSushi/invalid/float-no-trailing-digits.toml create mode 100644 tests/data/BurntSushi/invalid/float-underscore-after-point.toml create mode 100644 tests/data/BurntSushi/invalid/float-underscore-after.toml create mode 100644 tests/data/BurntSushi/invalid/float-underscore-before-point.toml create mode 100644 tests/data/BurntSushi/invalid/float-underscore-before.toml create mode 100644 tests/data/BurntSushi/invalid/inline-table-linebreak.toml create mode 100644 tests/data/BurntSushi/invalid/integer-leading-zero-neg.toml create mode 100644 tests/data/BurntSushi/invalid/integer-leading-zero-pos.toml create mode 100644 tests/data/BurntSushi/invalid/integer-leading-zero.toml create mode 100644 tests/data/BurntSushi/invalid/integer-underscore-after.toml create mode 100644 tests/data/BurntSushi/invalid/integer-underscore-before.toml create mode 100644 tests/data/BurntSushi/invalid/integer-underscore-double.toml create mode 100644 tests/data/BurntSushi/invalid/key-after-array.toml create mode 100644 tests/data/BurntSushi/invalid/key-after-table.toml create mode 100644 tests/data/BurntSushi/invalid/key-empty.toml create mode 100644 tests/data/BurntSushi/invalid/key-hash.toml create mode 100644 tests/data/BurntSushi/invalid/key-newline.toml create mode 100644 tests/data/BurntSushi/invalid/key-no-eol.toml create mode 100644 tests/data/BurntSushi/invalid/key-open-bracket.toml create mode 100644 tests/data/BurntSushi/invalid/key-single-open-bracket.toml create mode 100644 tests/data/BurntSushi/invalid/key-space.toml create mode 100644 tests/data/BurntSushi/invalid/key-start-bracket.toml create mode 100644 tests/data/BurntSushi/invalid/key-two-equals.toml create mode 100644 tests/data/BurntSushi/invalid/llbrace.toml create mode 100644 tests/data/BurntSushi/invalid/multi-line-inline-table.toml create mode 100644 tests/data/BurntSushi/invalid/multi-line-string-no-close.toml create mode 100644 tests/data/BurntSushi/invalid/rrbrace.toml create mode 100644 tests/data/BurntSushi/invalid/string-bad-byte-escape.toml create mode 100644 tests/data/BurntSushi/invalid/string-bad-codepoint.toml create mode 100644 tests/data/BurntSushi/invalid/string-bad-escape.toml create mode 100644 tests/data/BurntSushi/invalid/string-bad-slash-escape.toml create mode 100644 tests/data/BurntSushi/invalid/string-bad-uni-esc.toml create mode 100644 tests/data/BurntSushi/invalid/string-byte-escapes.toml create mode 100644 tests/data/BurntSushi/invalid/string-no-close.toml create mode 100644 tests/data/BurntSushi/invalid/table-array-implicit.toml create mode 100644 tests/data/BurntSushi/invalid/table-array-malformed-bracket.toml create mode 100644 tests/data/BurntSushi/invalid/table-array-malformed-empty.toml create mode 100644 tests/data/BurntSushi/invalid/table-empty.toml create mode 100644 tests/data/BurntSushi/invalid/table-nested-brackets-close.toml create mode 100644 tests/data/BurntSushi/invalid/table-nested-brackets-open.toml create mode 100644 tests/data/BurntSushi/invalid/table-whitespace.toml create mode 100644 tests/data/BurntSushi/invalid/table-with-pound.toml create mode 100644 tests/data/BurntSushi/invalid/text-after-array-entries.toml create mode 100644 tests/data/BurntSushi/invalid/text-after-integer.toml create mode 100644 tests/data/BurntSushi/invalid/text-after-string.toml create mode 100644 tests/data/BurntSushi/invalid/text-after-table.toml create mode 100644 tests/data/BurntSushi/invalid/text-before-array-separator.toml create mode 100644 tests/data/BurntSushi/invalid/text-in-array.toml create mode 100644 tests/data/BurntSushi/valid/array-empty.json create mode 100644 tests/data/BurntSushi/valid/array-empty.toml create mode 100644 tests/data/BurntSushi/valid/array-nospaces.json create mode 100644 tests/data/BurntSushi/valid/array-nospaces.toml create mode 100644 tests/data/BurntSushi/valid/array-string-quote-comma-2.json create mode 100644 tests/data/BurntSushi/valid/array-string-quote-comma-2.toml create mode 100644 tests/data/BurntSushi/valid/array-string-quote-comma.json create mode 100644 tests/data/BurntSushi/valid/array-string-quote-comma.toml create mode 100644 tests/data/BurntSushi/valid/array-string-with-comma.json create mode 100644 tests/data/BurntSushi/valid/array-string-with-comma.toml create mode 100644 tests/data/BurntSushi/valid/array-table-array-string-backslash.json create mode 100644 tests/data/BurntSushi/valid/array-table-array-string-backslash.toml create mode 100644 tests/data/BurntSushi/valid/arrays-hetergeneous.json create mode 100644 tests/data/BurntSushi/valid/arrays-hetergeneous.toml create mode 100644 tests/data/BurntSushi/valid/arrays-nested.json create mode 100644 tests/data/BurntSushi/valid/arrays-nested.toml create mode 100644 tests/data/BurntSushi/valid/arrays.json create mode 100644 tests/data/BurntSushi/valid/arrays.toml create mode 100644 tests/data/BurntSushi/valid/bool.json create mode 100644 tests/data/BurntSushi/valid/bool.toml create mode 100644 tests/data/BurntSushi/valid/comments-at-eof.json create mode 100644 tests/data/BurntSushi/valid/comments-at-eof.toml create mode 100644 tests/data/BurntSushi/valid/comments-at-eof2.json create mode 100644 tests/data/BurntSushi/valid/comments-at-eof2.toml create mode 100644 tests/data/BurntSushi/valid/comments-everywhere.json create mode 100644 tests/data/BurntSushi/valid/comments-everywhere.toml create mode 100644 tests/data/BurntSushi/valid/datetime-timezone.json create mode 100644 tests/data/BurntSushi/valid/datetime-timezone.toml create mode 100644 tests/data/BurntSushi/valid/datetime.json create mode 100644 tests/data/BurntSushi/valid/datetime.toml create mode 100644 tests/data/BurntSushi/valid/double-quote-escape.json create mode 100644 tests/data/BurntSushi/valid/double-quote-escape.toml create mode 100644 tests/data/BurntSushi/valid/empty.json create mode 100644 tests/data/BurntSushi/valid/empty.toml create mode 100644 tests/data/BurntSushi/valid/escaped-escape.json create mode 100644 tests/data/BurntSushi/valid/escaped-escape.toml create mode 100644 tests/data/BurntSushi/valid/example.json create mode 100644 tests/data/BurntSushi/valid/example.toml create mode 100644 tests/data/BurntSushi/valid/exponent-part-float.json create mode 100644 tests/data/BurntSushi/valid/exponent-part-float.toml create mode 100644 tests/data/BurntSushi/valid/float-exponent.json create mode 100644 tests/data/BurntSushi/valid/float-exponent.toml create mode 100644 tests/data/BurntSushi/valid/float-underscore.json create mode 100644 tests/data/BurntSushi/valid/float-underscore.toml create mode 100644 tests/data/BurntSushi/valid/float.json create mode 100644 tests/data/BurntSushi/valid/float.toml create mode 100644 tests/data/BurntSushi/valid/implicit-and-explicit-after.json create mode 100644 tests/data/BurntSushi/valid/implicit-and-explicit-after.toml create mode 100644 tests/data/BurntSushi/valid/implicit-and-explicit-before.json create mode 100644 tests/data/BurntSushi/valid/implicit-and-explicit-before.toml create mode 100644 tests/data/BurntSushi/valid/implicit-groups.json create mode 100644 tests/data/BurntSushi/valid/implicit-groups.toml create mode 100644 tests/data/BurntSushi/valid/inline-table-array.json create mode 100644 tests/data/BurntSushi/valid/inline-table-array.toml create mode 100644 tests/data/BurntSushi/valid/inline-table.json create mode 100644 tests/data/BurntSushi/valid/inline-table.toml create mode 100644 tests/data/BurntSushi/valid/integer-underscore.json create mode 100644 tests/data/BurntSushi/valid/integer-underscore.toml create mode 100644 tests/data/BurntSushi/valid/integer.json create mode 100644 tests/data/BurntSushi/valid/integer.toml create mode 100644 tests/data/BurntSushi/valid/key-equals-nospace.json create mode 100644 tests/data/BurntSushi/valid/key-equals-nospace.toml create mode 100644 tests/data/BurntSushi/valid/key-numeric.json create mode 100644 tests/data/BurntSushi/valid/key-numeric.toml create mode 100644 tests/data/BurntSushi/valid/key-space.json create mode 100644 tests/data/BurntSushi/valid/key-space.toml create mode 100644 tests/data/BurntSushi/valid/key-special-chars.json create mode 100644 tests/data/BurntSushi/valid/key-special-chars.toml create mode 100644 tests/data/BurntSushi/valid/keys-with-dots.json create mode 100644 tests/data/BurntSushi/valid/keys-with-dots.toml create mode 100644 tests/data/BurntSushi/valid/long-float.json create mode 100644 tests/data/BurntSushi/valid/long-float.toml create mode 100644 tests/data/BurntSushi/valid/long-integer.json create mode 100644 tests/data/BurntSushi/valid/long-integer.toml create mode 100644 tests/data/BurntSushi/valid/multiline-string.json create mode 100644 tests/data/BurntSushi/valid/multiline-string.toml create mode 100644 tests/data/BurntSushi/valid/nested-inline-table-array.json create mode 100644 tests/data/BurntSushi/valid/nested-inline-table-array.toml create mode 100644 tests/data/BurntSushi/valid/newline-crlf.json create mode 100644 tests/data/BurntSushi/valid/newline-crlf.toml create mode 100644 tests/data/BurntSushi/valid/newline-lf.json create mode 100644 tests/data/BurntSushi/valid/newline-lf.toml create mode 100644 tests/data/BurntSushi/valid/raw-multiline-string.json create mode 100644 tests/data/BurntSushi/valid/raw-multiline-string.toml create mode 100644 tests/data/BurntSushi/valid/raw-string.json create mode 100644 tests/data/BurntSushi/valid/raw-string.toml create mode 100644 tests/data/BurntSushi/valid/right-curly-brace-after-boolean.json create mode 100644 tests/data/BurntSushi/valid/right-curly-brace-after-boolean.toml create mode 100644 tests/data/BurntSushi/valid/string-empty.json create mode 100644 tests/data/BurntSushi/valid/string-empty.toml create mode 100644 tests/data/BurntSushi/valid/string-escapes.json create mode 100644 tests/data/BurntSushi/valid/string-escapes.toml create mode 100644 tests/data/BurntSushi/valid/string-nl.json create mode 100644 tests/data/BurntSushi/valid/string-nl.toml create mode 100644 tests/data/BurntSushi/valid/string-simple.json create mode 100644 tests/data/BurntSushi/valid/string-simple.toml create mode 100644 tests/data/BurntSushi/valid/string-with-pound.json create mode 100644 tests/data/BurntSushi/valid/string-with-pound.toml create mode 100644 tests/data/BurntSushi/valid/table-array-implicit.json create mode 100644 tests/data/BurntSushi/valid/table-array-implicit.toml create mode 100644 tests/data/BurntSushi/valid/table-array-many.json create mode 100644 tests/data/BurntSushi/valid/table-array-many.toml create mode 100644 tests/data/BurntSushi/valid/table-array-nest.json create mode 100644 tests/data/BurntSushi/valid/table-array-nest.toml create mode 100644 tests/data/BurntSushi/valid/table-array-one.json create mode 100644 tests/data/BurntSushi/valid/table-array-one.toml create mode 100644 tests/data/BurntSushi/valid/table-array-table-array.json create mode 100644 tests/data/BurntSushi/valid/table-array-table-array.toml create mode 100644 tests/data/BurntSushi/valid/table-empty.json create mode 100644 tests/data/BurntSushi/valid/table-empty.toml create mode 100644 tests/data/BurntSushi/valid/table-no-eol.json create mode 100644 tests/data/BurntSushi/valid/table-no-eol.toml create mode 100644 tests/data/BurntSushi/valid/table-sub-empty.json create mode 100644 tests/data/BurntSushi/valid/table-sub-empty.toml create mode 100644 tests/data/BurntSushi/valid/table-whitespace.json create mode 100644 tests/data/BurntSushi/valid/table-whitespace.toml create mode 100644 tests/data/BurntSushi/valid/table-with-literal-string.json create mode 100644 tests/data/BurntSushi/valid/table-with-literal-string.toml create mode 100644 tests/data/BurntSushi/valid/table-with-pound.json create mode 100644 tests/data/BurntSushi/valid/table-with-pound.toml create mode 100644 tests/data/BurntSushi/valid/table-with-single-quotes.json create mode 100644 tests/data/BurntSushi/valid/table-with-single-quotes.toml create mode 100644 tests/data/BurntSushi/valid/table-without-super.json create mode 100644 tests/data/BurntSushi/valid/table-without-super.toml create mode 100644 tests/data/BurntSushi/valid/underscored-float.json create mode 100644 tests/data/BurntSushi/valid/underscored-float.toml create mode 100644 tests/data/BurntSushi/valid/underscored-integer.json create mode 100644 tests/data/BurntSushi/valid/underscored-integer.toml create mode 100644 tests/data/BurntSushi/valid/unicode-escape.json create mode 100644 tests/data/BurntSushi/valid/unicode-escape.toml create mode 100644 tests/data/BurntSushi/valid/unicode-literal.json create mode 100644 tests/data/BurntSushi/valid/unicode-literal.toml create mode 100644 tests/test_fixtures.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..c4a3928 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,13 @@ +[bumpversion] +commit = True +tag = True +tag_name = {new_version} +current_version = 0.0.0 + +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT +replace = version = "{new_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT + +[bumpversion:file:lil-toml/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..367e8ec --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +max-line-length = 88 +max-complexity = 10 +# These checks violate PEP8 so let's ignore them +extend-ignore = E203 +extend-exclude = */site-packages/* diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..d2cd707 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,85 @@ +name: Tests + +on: + push: + branches: [ master ] + tags: + - '*.*.*' + pull_request: + branches: [ master ] + +jobs: + + linters: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Installation (deps and package) + run: | + pip install "poetry==1.1.6" + poetry config virtualenvs.create false + poetry install --no-interaction --no-ansi + + - name: run linters + run: | + mypy . + pre-commit run -a + + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev] + os: [ubuntu-latest, macos-latest, windows-latest] + continue-on-error: ${{ matrix.python-version == '3.10-dev' }} + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Installation (deps and package) + run: | + pip install "poetry==1.1.6" + poetry config virtualenvs.create false + poetry install --no-interaction --no-ansi + + - name: Test with pytest + run: | + pytest --cov --cov-fail-under=95 + + - name: Report coverage + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.6' + uses: codecov/codecov-action@v1 + + pypi-publish: + # Only publish if all other jobs succeed + needs: + - linters + - tests + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install Poetry + run: | + pip install "poetry==1.1.6" + - name: Build and publish + run: | + # TODO: Remove the first command as soon as this Poetry bug is fixed: https://github.com/python-poetry/poetry/issues/2210 + poetry config http-basic.pypi "__token__" "${POETRY_PYPI_TOKEN_PYPI}" + poetry build + poetry publish + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..18bffe1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,135 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# IntelliJ +.idea/ + +# VS Code +.vscode/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a67583e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +repos: +- repo: https://github.com/executablebooks/mdformat + rev: 0.7.6 + hooks: + - id: mdformat + additional_dependencies: + - mdformat-black +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: 38b88246ccc552bffaaf54259d064beeee434539 # frozen: v4.0.1 + hooks: + - id: check-yaml +- repo: https://github.com/pre-commit/pygrep-hooks + rev: 58ace0d0dc6b2439b737a5ea353f836f6a2bad13 # frozen: v1.8.0 + hooks: + - id: python-use-type-annotations + - id: python-check-blanket-noqa +- repo: https://github.com/timothycrosley/isort + rev: a6222a8a125ec719724e628a5d3d0d5c60923281 # frozen: 5.8.0 + hooks: + - id: isort +- repo: https://github.com/psf/black + rev: 2f52e4b4929370ec503ee272bcc10d3176db8e89 # frozen: 21.5b1 + hooks: + - id: black +- repo: https://github.com/myint/docformatter + rev: 67919ee01837761f2d954d7fbb08c12cdd38ec5a # frozen: v1.4 + hooks: + - id: docformatter +- repo: https://gitlab.com/pycqa/flake8 + rev: dcd740bc0ebaf2b3d43e59a0060d157c97de13f3 # frozen: 3.9.2 + hooks: + - id: flake8 + additional_dependencies: + - flake8-bugbear + - flake8-builtins + - flake8-comprehensions diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e859590 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Taneli Hukkinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..12a0ef8 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +[![Build Status](https://github.com/hukkinj1/lil-toml/workflows/Tests/badge.svg?branch=master)](https://github.com/hukkinj1/lil-toml/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush) +[![codecov.io](https://codecov.io/gh/hukkinj1/lil-toml/branch/master/graph/badge.svg)](https://codecov.io/gh/hukkinj1/lil-toml) +[![PyPI version](https://img.shields.io/pypi/v/lil-toml)](https://pypi.org/project/lil-toml) + +# Lil' TOML + +> TODO: What is lil-toml? + +## Installing + +```bash +pip install lil-toml +``` diff --git a/lil_toml/__init__.py b/lil_toml/__init__.py new file mode 100644 index 0000000..24b995d --- /dev/null +++ b/lil_toml/__init__.py @@ -0,0 +1,12 @@ +from typing import Any + +__all__ = ("loads", "dumps") +__version__ = "0.0.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT + + +def loads(s: str) -> dict: + return {} + + +def dumps(*args: Any, **kwargs: Any) -> str: + raise NotImplementedError diff --git a/lil_toml/py.typed b/lil_toml/py.typed new file mode 100644 index 0000000..7632ecf --- /dev/null +++ b/lil_toml/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..1ff2f62 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,588 @@ +[[package]] +name = "appdirs" +version = "1.4.4" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "21.2.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.extras] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] +docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] + +[[package]] +name = "bump2version" +version = "1.0.1" +description = "Version-bump your software with a single command!" +category = "dev" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "cfgv" +version = "3.3.0" +description = "Validate configuration and produce human readable error messages." +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "coverage" +version = "5.5" +description = "Code coverage measurement for Python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.dependencies] +toml = {version = "*", optional = true, markers = "extra == \"toml\""} + +[package.extras] +toml = ["toml"] + +[[package]] +name = "distlib" +version = "0.3.1" +description = "Distribution utilities" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "filelock" +version = "3.0.12" +description = "A platform independent file lock." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "identify" +version = "2.2.5" +description = "File identification library for Python" +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[package.extras] +license = ["editdistance-s"] + +[[package]] +name = "importlib-metadata" +version = "4.0.1" +description = "Read metadata from Python packages" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] + +[[package]] +name = "importlib-resources" +version = "5.1.4" +description = "Read resources from Python packages" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy"] + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "mypy" +version = "0.820+dev.b633ae123b816e45058853d42bbd9a1f82af1a23" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.5" +develop = false + +[package.dependencies] +mypy-extensions = ">=0.4.3,<0.5.0" +toml = "*" +typed-ast = {version = ">=1.4.0,<1.5.0", markers = "python_version < \"3.8\""} +typing-extensions = ">=3.7.4" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +python2 = ["typed-ast (>=1.4.0,<1.5.0)"] + +[package.source] +type = "git" +url = "https://github.com/python/mypy.git" +reference = "master" +resolved_reference = "b633ae123b816e45058853d42bbd9a1f82af1a23" + +[[package]] +name = "mypy-extensions" +version = "0.4.3" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "nodeenv" +version = "1.6.0" +description = "Node.js virtual environment builder" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "packaging" +version = "20.9" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +pyparsing = ">=2.0.2" + +[[package]] +name = "pluggy" +version = "0.13.1" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +dev = ["pre-commit", "tox"] + +[[package]] +name = "pre-commit" +version = "2.13.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} +importlib-resources = {version = "*", markers = "python_version < \"3.7\""} +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +toml = "*" +virtualenv = ">=20.0.8" + +[[package]] +name = "py" +version = "1.10.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pyparsing" +version = "2.4.7" +description = "Python parsing module" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "pytest" +version = "6.2.4" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<1.0.0a1" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "pytest-cov" +version = "2.12.0" +description = "Pytest plugin for measuring coverage." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests (==2.0.2)", "six", "pytest-xdist", "virtualenv"] + +[[package]] +name = "pytest-randomly" +version = "3.8.0" +description = "Pytest plugin to randomly order tests and control random.seed." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""} +pytest = "*" + +[[package]] +name = "pyyaml" +version = "5.4.1" +description = "YAML parser and emitter for Python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "typed-ast" +version = "1.4.3" +description = "a fork of Python 2 and 3 ast modules with type comment support" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "typing-extensions" +version = "3.10.0.0" +description = "Backported and Experimental Type Hints for Python 3.5+" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "virtualenv" +version = "20.4.6" +description = "Virtual Python Environment builder" +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" + +[package.dependencies] +appdirs = ">=1.4.3,<2" +distlib = ">=0.3.1,<1" +filelock = ">=3.0.0,<4" +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +importlib-resources = {version = ">=1.0", markers = "python_version < \"3.7\""} +six = ">=1.9.0,<2" + +[package.extras] +docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=19.9.0rc1)"] +testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "packaging (>=20.0)", "xonsh (>=0.9.16)"] + +[[package]] +name = "zipp" +version = "3.4.1" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "pytest-enabler", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.6.1" +content-hash = "8884c17d229b05d4f7cc6d225a09c22a676b118efc9bf3b5185b89c0df49f0cc" + +[metadata.files] +appdirs = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] +atomicwrites = [ + {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, + {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, +] +attrs = [ + {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, + {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, +] +bump2version = [ + {file = "bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410"}, + {file = "bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6"}, +] +cfgv = [ + {file = "cfgv-3.3.0-py2.py3-none-any.whl", hash = "sha256:b449c9c6118fe8cca7fa5e00b9ec60ba08145d281d52164230a69211c5d597a1"}, + {file = "cfgv-3.3.0.tar.gz", hash = "sha256:9e600479b3b99e8af981ecdfc80a0296104ee610cab48a5ae4ffd0b668650eb1"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +coverage = [ + {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"}, + {file = "coverage-5.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b"}, + {file = "coverage-5.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669"}, + {file = "coverage-5.5-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90"}, + {file = "coverage-5.5-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c"}, + {file = "coverage-5.5-cp27-cp27m-win32.whl", hash = "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a"}, + {file = "coverage-5.5-cp27-cp27m-win_amd64.whl", hash = "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82"}, + {file = "coverage-5.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905"}, + {file = "coverage-5.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083"}, + {file = "coverage-5.5-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5"}, + {file = "coverage-5.5-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81"}, + {file = "coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6"}, + {file = "coverage-5.5-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0"}, + {file = "coverage-5.5-cp310-cp310-win_amd64.whl", hash = "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae"}, + {file = "coverage-5.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb"}, + {file = "coverage-5.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160"}, + {file = "coverage-5.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"}, + {file = "coverage-5.5-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701"}, + {file = "coverage-5.5-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793"}, + {file = "coverage-5.5-cp35-cp35m-win32.whl", hash = "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e"}, + {file = "coverage-5.5-cp35-cp35m-win_amd64.whl", hash = "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3"}, + {file = "coverage-5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066"}, + {file = "coverage-5.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a"}, + {file = "coverage-5.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465"}, + {file = "coverage-5.5-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb"}, + {file = "coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821"}, + {file = "coverage-5.5-cp36-cp36m-win32.whl", hash = "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45"}, + {file = "coverage-5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184"}, + {file = "coverage-5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a"}, + {file = "coverage-5.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53"}, + {file = "coverage-5.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d"}, + {file = "coverage-5.5-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638"}, + {file = "coverage-5.5-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3"}, + {file = "coverage-5.5-cp37-cp37m-win32.whl", hash = "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a"}, + {file = "coverage-5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a"}, + {file = "coverage-5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6"}, + {file = "coverage-5.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2"}, + {file = "coverage-5.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759"}, + {file = "coverage-5.5-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873"}, + {file = "coverage-5.5-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a"}, + {file = "coverage-5.5-cp38-cp38-win32.whl", hash = "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6"}, + {file = "coverage-5.5-cp38-cp38-win_amd64.whl", hash = "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502"}, + {file = "coverage-5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b"}, + {file = "coverage-5.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529"}, + {file = "coverage-5.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b"}, + {file = "coverage-5.5-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff"}, + {file = "coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b"}, + {file = "coverage-5.5-cp39-cp39-win32.whl", hash = "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6"}, + {file = "coverage-5.5-cp39-cp39-win_amd64.whl", hash = "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03"}, + {file = "coverage-5.5-pp36-none-any.whl", hash = "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079"}, + {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"}, + {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, +] +distlib = [ + {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, + {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, +] +filelock = [ + {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, + {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, +] +identify = [ + {file = "identify-2.2.5-py2.py3-none-any.whl", hash = "sha256:9c3ab58543c03bd794a1735e4552ef6dec49ec32053278130d525f0982447d47"}, + {file = "identify-2.2.5.tar.gz", hash = "sha256:bc1705694253763a3160b943316867792ec00ba7a0ee40b46e20aebaf4e0c46a"}, +] +importlib-metadata = [ + {file = "importlib_metadata-4.0.1-py3-none-any.whl", hash = "sha256:d7eb1dea6d6a6086f8be21784cc9e3bcfa55872b52309bc5fad53a8ea444465d"}, + {file = "importlib_metadata-4.0.1.tar.gz", hash = "sha256:8c501196e49fb9df5df43833bdb1e4328f64847763ec8a50703148b73784d581"}, +] +importlib-resources = [ + {file = "importlib_resources-5.1.4-py3-none-any.whl", hash = "sha256:e962bff7440364183203d179d7ae9ad90cb1f2b74dcb84300e88ecc42dca3351"}, + {file = "importlib_resources-5.1.4.tar.gz", hash = "sha256:54161657e8ffc76596c4ede7080ca68cb02962a2e074a2586b695a93a925d36e"}, +] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] +mypy = [] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] +nodeenv = [ + {file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"}, + {file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"}, +] +packaging = [ + {file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"}, + {file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"}, +] +pluggy = [ + {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, + {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, +] +pre-commit = [ + {file = "pre_commit-2.13.0-py2.py3-none-any.whl", hash = "sha256:b679d0fddd5b9d6d98783ae5f10fd0c4c59954f375b70a58cbe1ce9bcf9809a4"}, + {file = "pre_commit-2.13.0.tar.gz", hash = "sha256:764972c60693dc668ba8e86eb29654ec3144501310f7198742a767bec385a378"}, +] +py = [ + {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, + {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, +] +pyparsing = [ + {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, + {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, +] +pytest = [ + {file = "pytest-6.2.4-py3-none-any.whl", hash = "sha256:91ef2131a9bd6be8f76f1f08eac5c5317221d6ad1e143ae03894b862e8976890"}, + {file = "pytest-6.2.4.tar.gz", hash = "sha256:50bcad0a0b9c5a72c8e4e7c9855a3ad496ca6a881a3641b4260605450772c54b"}, +] +pytest-cov = [ + {file = "pytest-cov-2.12.0.tar.gz", hash = "sha256:8535764137fecce504a49c2b742288e3d34bc09eed298ad65963616cc98fd45e"}, + {file = "pytest_cov-2.12.0-py2.py3-none-any.whl", hash = "sha256:95d4933dcbbacfa377bb60b29801daa30d90c33981ab2a79e9ab4452c165066e"}, +] +pytest-randomly = [ + {file = "pytest-randomly-3.8.0.tar.gz", hash = "sha256:d9e21a72446757129378beea00bc9a32df1fb1cfd0bbe408be1ae9685bdf1209"}, + {file = "pytest_randomly-3.8.0-py3-none-any.whl", hash = "sha256:f5b7a09e84ee1eabcdedbb73c51d0929ae2f582bab6941dbb513bb49296d6340"}, +] +pyyaml = [ + {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, + {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, + {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, + {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, + {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, + {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, + {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, + {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, + {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, + {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, + {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, + {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, + {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, + {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, + {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, + {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, + {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, +] +six = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] +typed-ast = [ + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3"}, + {file = "typed_ast-1.4.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7"}, + {file = "typed_ast-1.4.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805"}, + {file = "typed_ast-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39"}, + {file = "typed_ast-1.4.3-cp38-cp38-win32.whl", hash = "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927"}, + {file = "typed_ast-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40"}, + {file = "typed_ast-1.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3"}, + {file = "typed_ast-1.4.3-cp39-cp39-win32.whl", hash = "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808"}, + {file = "typed_ast-1.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c"}, + {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, +] +typing-extensions = [ + {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, + {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, + {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, +] +virtualenv = [ + {file = "virtualenv-20.4.6-py2.py3-none-any.whl", hash = "sha256:307a555cf21e1550885c82120eccaf5acedf42978fd362d32ba8410f9593f543"}, + {file = "virtualenv-20.4.6.tar.gz", hash = "sha256:72cf267afc04bf9c86ec932329b7e94db6a0331ae9847576daaa7ca3c86b29a4"}, +] +zipp = [ + {file = "zipp-3.4.1-py3-none-any.whl", hash = "sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098"}, + {file = "zipp-3.4.1.tar.gz", hash = "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c3425c8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,135 @@ +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + + +[tool.poetry] +name = "lil-toml" +version = "0.0.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT +authors = ["Taneli Hukkinen "] +description = "TODO: What is lil-toml?" +repository = "https://github.com/hukkinj1/lil-toml" +readme = "README.md" +license = "MIT" +classifiers = [ + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", +] +keywords = ["toml"] + +packages = [ + {include = "lil_toml"}, +] +include = ["lil-toml/py.typed"] + +[tool.poetry.urls] +"Changelog" = "https://github.com/hukkinj1/lil-toml/TODO" + +[tool.poetry.dependencies] +python = "^3.6.1" + +[tool.poetry.dev-dependencies] +# Tests +pytest = "*" +pytest-randomly = "*" +pytest-cov = "*" + +# Tools +pre-commit = "*" +# TODO: switch from git to pypi after next mypy release +#mypy = "*" # this is separate to pre-commit, since it requires an external env +mypy = { git = "https://github.com/python/mypy.git", branch = "master" } +bump2version = "*" + + +[tool.isort] +# Force imports to be sorted by module, independent of import type +force_sort_within_sections = true +# Group first party and local folder imports together +no_lines_before = ["LOCALFOLDER"] + +# Configure isort to work without access to site-packages +known_first_party = ["lil-toml", "tests"] + +# Settings for Black compatibility +profile = "black" + + +[tool.pytest.ini_options] +addopts = "--strict-markers --strict-config" +xfail_strict = true + + +[tool.tox] +legacy_tox_ini = """ +[tox] +# Only run pytest envs when no args given to tox +envlist = py{36,37,38,39} +isolated_build = True +requires = + poetry >= 1.1.4 + +[testenv] +allowlist_externals = poetry + +[testenv:py{36,37,38,39}] +description = run tests +commands_pre = + # TODO: Use --dev-only flag when poetry 1.2 is released + poetry install --no-root +commands = + pytest {posargs} + +[testenv:pre-commit] +description = run linters (except mypy) +skip_install = True +deps = pre-commit +commands = pre-commit run {posargs:--all} + +[testenv:mypy] +description = run mypy +basepython = python3.8 +commands_pre = + # TODO: Use --dev-only flag when poetry 1.2 is released + poetry install --no-root +commands = + mypy {posargs:.} +""" + + +[tool.coverage.run] +omit = ["tests/*", "*/site-packages/*"] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + # Ellipsis lines after @typing.overload + '\.\.\.', + # Code for static type checkers + "if TYPE_CHECKING:", + # Scripts + 'if __name__ == .__main__.:', +] + + +[tool.mypy] +warn_unreachable = true +warn_unused_ignores = true +warn_redundant_casts = true +warn_unused_configs = true +# Disabling incremental mode is required for `warn_unused_configs = true` to work +incremental = false +disallow_untyped_defs = true +check_untyped_defs = true +strict_equality = true +implicit_reexport = false +no_implicit_optional = true + +[[tool.mypy.overrides]] +module = "tests.*" +disallow_untyped_defs = false diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/BurntSushi/LICENSE b/tests/data/BurntSushi/LICENSE new file mode 100644 index 0000000..5bbfd82 --- /dev/null +++ b/tests/data/BurntSushi/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 TOML authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/tests/data/BurntSushi/README.md b/tests/data/BurntSushi/README.md new file mode 100644 index 0000000..b9da8d2 --- /dev/null +++ b/tests/data/BurntSushi/README.md @@ -0,0 +1 @@ +Test data copied from https://github.com/BurntSushi/toml-test/tree/9767d201b51ac9c50630f181828bcd922bf3e9e5 diff --git a/tests/data/BurntSushi/invalid/array-mixed-types-arrays-and-ints.toml b/tests/data/BurntSushi/invalid/array-mixed-types-arrays-and-ints.toml new file mode 100644 index 0000000..051ec73 --- /dev/null +++ b/tests/data/BurntSushi/invalid/array-mixed-types-arrays-and-ints.toml @@ -0,0 +1 @@ +arrays-and-ints = [1, ["Arrays are not integers."]] diff --git a/tests/data/BurntSushi/invalid/array-mixed-types-ints-and-floats.toml b/tests/data/BurntSushi/invalid/array-mixed-types-ints-and-floats.toml new file mode 100644 index 0000000..a5aa9b7 --- /dev/null +++ b/tests/data/BurntSushi/invalid/array-mixed-types-ints-and-floats.toml @@ -0,0 +1 @@ +ints-and-floats = [1, 1.1] diff --git a/tests/data/BurntSushi/invalid/array-mixed-types-strings-and-ints.toml b/tests/data/BurntSushi/invalid/array-mixed-types-strings-and-ints.toml new file mode 100644 index 0000000..f348308 --- /dev/null +++ b/tests/data/BurntSushi/invalid/array-mixed-types-strings-and-ints.toml @@ -0,0 +1 @@ +strings-and-ints = ["hi", 42] diff --git a/tests/data/BurntSushi/invalid/bool-wrong-case-false.toml b/tests/data/BurntSushi/invalid/bool-wrong-case-false.toml new file mode 100644 index 0000000..3982220 --- /dev/null +++ b/tests/data/BurntSushi/invalid/bool-wrong-case-false.toml @@ -0,0 +1 @@ +b = FALSE diff --git a/tests/data/BurntSushi/invalid/bool-wrong-case-true.toml b/tests/data/BurntSushi/invalid/bool-wrong-case-true.toml new file mode 100644 index 0000000..85e34c5 --- /dev/null +++ b/tests/data/BurntSushi/invalid/bool-wrong-case-true.toml @@ -0,0 +1 @@ +a = TRUE diff --git a/tests/data/BurntSushi/invalid/datetime-malformed-no-leads.toml b/tests/data/BurntSushi/invalid/datetime-malformed-no-leads.toml new file mode 100644 index 0000000..123f173 --- /dev/null +++ b/tests/data/BurntSushi/invalid/datetime-malformed-no-leads.toml @@ -0,0 +1 @@ +no-leads = 1987-7-05T17:45:00Z diff --git a/tests/data/BurntSushi/invalid/datetime-malformed-no-secs.toml b/tests/data/BurntSushi/invalid/datetime-malformed-no-secs.toml new file mode 100644 index 0000000..ba93900 --- /dev/null +++ b/tests/data/BurntSushi/invalid/datetime-malformed-no-secs.toml @@ -0,0 +1 @@ +no-secs = 1987-07-05T17:45Z diff --git a/tests/data/BurntSushi/invalid/datetime-malformed-no-t.toml b/tests/data/BurntSushi/invalid/datetime-malformed-no-t.toml new file mode 100644 index 0000000..617e3c5 --- /dev/null +++ b/tests/data/BurntSushi/invalid/datetime-malformed-no-t.toml @@ -0,0 +1 @@ +no-t = 1987-07-0517:45:00Z diff --git a/tests/data/BurntSushi/invalid/datetime-malformed-with-milli.toml b/tests/data/BurntSushi/invalid/datetime-malformed-with-milli.toml new file mode 100644 index 0000000..eef792f --- /dev/null +++ b/tests/data/BurntSushi/invalid/datetime-malformed-with-milli.toml @@ -0,0 +1 @@ +with-milli = 1987-07-5T17:45:00.12Z diff --git a/tests/data/BurntSushi/invalid/duplicate-key-table.toml b/tests/data/BurntSushi/invalid/duplicate-key-table.toml new file mode 100644 index 0000000..cedf05f --- /dev/null +++ b/tests/data/BurntSushi/invalid/duplicate-key-table.toml @@ -0,0 +1,5 @@ +[fruit] +type = "apple" + +[fruit.type] +apple = "yes" diff --git a/tests/data/BurntSushi/invalid/duplicate-keys.toml b/tests/data/BurntSushi/invalid/duplicate-keys.toml new file mode 100644 index 0000000..9b5aee0 --- /dev/null +++ b/tests/data/BurntSushi/invalid/duplicate-keys.toml @@ -0,0 +1,2 @@ +dupe = false +dupe = true diff --git a/tests/data/BurntSushi/invalid/duplicate-tables.toml b/tests/data/BurntSushi/invalid/duplicate-tables.toml new file mode 100644 index 0000000..8ddf49b --- /dev/null +++ b/tests/data/BurntSushi/invalid/duplicate-tables.toml @@ -0,0 +1,2 @@ +[a] +[a] diff --git a/tests/data/BurntSushi/invalid/empty-implicit-table.toml b/tests/data/BurntSushi/invalid/empty-implicit-table.toml new file mode 100644 index 0000000..0cc36d0 --- /dev/null +++ b/tests/data/BurntSushi/invalid/empty-implicit-table.toml @@ -0,0 +1 @@ +[naughty..naughty] diff --git a/tests/data/BurntSushi/invalid/empty-table.toml b/tests/data/BurntSushi/invalid/empty-table.toml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/data/BurntSushi/invalid/empty-table.toml @@ -0,0 +1 @@ +[] diff --git a/tests/data/BurntSushi/invalid/float-leading-zero-neg.toml b/tests/data/BurntSushi/invalid/float-leading-zero-neg.toml new file mode 100644 index 0000000..dbc16ff --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-leading-zero-neg.toml @@ -0,0 +1 @@ +leading-zero = -03.14 diff --git a/tests/data/BurntSushi/invalid/float-leading-zero-pos.toml b/tests/data/BurntSushi/invalid/float-leading-zero-pos.toml new file mode 100644 index 0000000..6de9634 --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-leading-zero-pos.toml @@ -0,0 +1 @@ +leading-zero = +03.14 diff --git a/tests/data/BurntSushi/invalid/float-leading-zero.toml b/tests/data/BurntSushi/invalid/float-leading-zero.toml new file mode 100644 index 0000000..551fb25 --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-leading-zero.toml @@ -0,0 +1 @@ +leading-zero = 03.14 diff --git a/tests/data/BurntSushi/invalid/float-no-leading-zero.toml b/tests/data/BurntSushi/invalid/float-no-leading-zero.toml new file mode 100644 index 0000000..cab76bf --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-no-leading-zero.toml @@ -0,0 +1,2 @@ +answer = .12345 +neganswer = -.12345 diff --git a/tests/data/BurntSushi/invalid/float-no-trailing-digits.toml b/tests/data/BurntSushi/invalid/float-no-trailing-digits.toml new file mode 100644 index 0000000..cbff2d0 --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-no-trailing-digits.toml @@ -0,0 +1,2 @@ +answer = 1. +neganswer = -1. diff --git a/tests/data/BurntSushi/invalid/float-underscore-after-point.toml b/tests/data/BurntSushi/invalid/float-underscore-after-point.toml new file mode 100644 index 0000000..fe2f2e2 --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-underscore-after-point.toml @@ -0,0 +1 @@ +bad = 1._2 diff --git a/tests/data/BurntSushi/invalid/float-underscore-after.toml b/tests/data/BurntSushi/invalid/float-underscore-after.toml new file mode 100644 index 0000000..33f2bae --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-underscore-after.toml @@ -0,0 +1 @@ +bad = 1.2_ diff --git a/tests/data/BurntSushi/invalid/float-underscore-before-point.toml b/tests/data/BurntSushi/invalid/float-underscore-before-point.toml new file mode 100644 index 0000000..0aa1722 --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-underscore-before-point.toml @@ -0,0 +1 @@ +bad = 1_.2 diff --git a/tests/data/BurntSushi/invalid/float-underscore-before.toml b/tests/data/BurntSushi/invalid/float-underscore-before.toml new file mode 100644 index 0000000..155de0f --- /dev/null +++ b/tests/data/BurntSushi/invalid/float-underscore-before.toml @@ -0,0 +1 @@ +bad = _1.2 diff --git a/tests/data/BurntSushi/invalid/inline-table-linebreak.toml b/tests/data/BurntSushi/invalid/inline-table-linebreak.toml new file mode 100644 index 0000000..094fb2c --- /dev/null +++ b/tests/data/BurntSushi/invalid/inline-table-linebreak.toml @@ -0,0 +1,2 @@ +simple = { a = 1 +} diff --git a/tests/data/BurntSushi/invalid/integer-leading-zero-neg.toml b/tests/data/BurntSushi/invalid/integer-leading-zero-neg.toml new file mode 100644 index 0000000..ff6836b --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-leading-zero-neg.toml @@ -0,0 +1 @@ +leading-zero = -012 diff --git a/tests/data/BurntSushi/invalid/integer-leading-zero-pos.toml b/tests/data/BurntSushi/invalid/integer-leading-zero-pos.toml new file mode 100644 index 0000000..4e63542 --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-leading-zero-pos.toml @@ -0,0 +1 @@ +leading-zero = +012 diff --git a/tests/data/BurntSushi/invalid/integer-leading-zero.toml b/tests/data/BurntSushi/invalid/integer-leading-zero.toml new file mode 100644 index 0000000..38b1ca4 --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-leading-zero.toml @@ -0,0 +1 @@ +leading-zero = 012 diff --git a/tests/data/BurntSushi/invalid/integer-underscore-after.toml b/tests/data/BurntSushi/invalid/integer-underscore-after.toml new file mode 100644 index 0000000..b9ec0ee --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-underscore-after.toml @@ -0,0 +1 @@ +bad = 123_ diff --git a/tests/data/BurntSushi/invalid/integer-underscore-before.toml b/tests/data/BurntSushi/invalid/integer-underscore-before.toml new file mode 100644 index 0000000..1f96c4a --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-underscore-before.toml @@ -0,0 +1 @@ +bad = _123 diff --git a/tests/data/BurntSushi/invalid/integer-underscore-double.toml b/tests/data/BurntSushi/invalid/integer-underscore-double.toml new file mode 100644 index 0000000..490adb3 --- /dev/null +++ b/tests/data/BurntSushi/invalid/integer-underscore-double.toml @@ -0,0 +1 @@ +bad = 1__23 diff --git a/tests/data/BurntSushi/invalid/key-after-array.toml b/tests/data/BurntSushi/invalid/key-after-array.toml new file mode 100644 index 0000000..5c1a1b0 --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-after-array.toml @@ -0,0 +1 @@ +[[agencies]] owner = "S Cjelli" diff --git a/tests/data/BurntSushi/invalid/key-after-table.toml b/tests/data/BurntSushi/invalid/key-after-table.toml new file mode 100644 index 0000000..6886784 --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-after-table.toml @@ -0,0 +1 @@ +[error] this = "should not be here" diff --git a/tests/data/BurntSushi/invalid/key-empty.toml b/tests/data/BurntSushi/invalid/key-empty.toml new file mode 100644 index 0000000..09f998f --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-empty.toml @@ -0,0 +1 @@ + = 1 diff --git a/tests/data/BurntSushi/invalid/key-hash.toml b/tests/data/BurntSushi/invalid/key-hash.toml new file mode 100644 index 0000000..e321b1f --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-hash.toml @@ -0,0 +1 @@ +a# = 1 diff --git a/tests/data/BurntSushi/invalid/key-newline.toml b/tests/data/BurntSushi/invalid/key-newline.toml new file mode 100644 index 0000000..707aad5 --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-newline.toml @@ -0,0 +1,2 @@ +a += 1 diff --git a/tests/data/BurntSushi/invalid/key-no-eol.toml b/tests/data/BurntSushi/invalid/key-no-eol.toml new file mode 100644 index 0000000..3c58eee --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-no-eol.toml @@ -0,0 +1 @@ +a = 1 b = 2 diff --git a/tests/data/BurntSushi/invalid/key-open-bracket.toml b/tests/data/BurntSushi/invalid/key-open-bracket.toml new file mode 100644 index 0000000..f0aeb16 --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-open-bracket.toml @@ -0,0 +1 @@ +[abc = 1 diff --git a/tests/data/BurntSushi/invalid/key-single-open-bracket.toml b/tests/data/BurntSushi/invalid/key-single-open-bracket.toml new file mode 100644 index 0000000..8e2f0be --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-single-open-bracket.toml @@ -0,0 +1 @@ +[ \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/key-space.toml b/tests/data/BurntSushi/invalid/key-space.toml new file mode 100644 index 0000000..201806d --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-space.toml @@ -0,0 +1 @@ +a b = 1 \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/key-start-bracket.toml b/tests/data/BurntSushi/invalid/key-start-bracket.toml new file mode 100644 index 0000000..e0597ae --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-start-bracket.toml @@ -0,0 +1,3 @@ +[a] +[xyz = 5 +[b] diff --git a/tests/data/BurntSushi/invalid/key-two-equals.toml b/tests/data/BurntSushi/invalid/key-two-equals.toml new file mode 100644 index 0000000..25a0378 --- /dev/null +++ b/tests/data/BurntSushi/invalid/key-two-equals.toml @@ -0,0 +1 @@ +key= = 1 diff --git a/tests/data/BurntSushi/invalid/llbrace.toml b/tests/data/BurntSushi/invalid/llbrace.toml new file mode 100644 index 0000000..047978e --- /dev/null +++ b/tests/data/BurntSushi/invalid/llbrace.toml @@ -0,0 +1 @@ +[ [table]] diff --git a/tests/data/BurntSushi/invalid/multi-line-inline-table.toml b/tests/data/BurntSushi/invalid/multi-line-inline-table.toml new file mode 100644 index 0000000..a195e1b --- /dev/null +++ b/tests/data/BurntSushi/invalid/multi-line-inline-table.toml @@ -0,0 +1,4 @@ +json_like = { + first = "Tom", + last = "Preston-Werner" +} \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/multi-line-string-no-close.toml b/tests/data/BurntSushi/invalid/multi-line-string-no-close.toml new file mode 100644 index 0000000..4ca9597 --- /dev/null +++ b/tests/data/BurntSushi/invalid/multi-line-string-no-close.toml @@ -0,0 +1,2 @@ +invalid = """ + this will fail diff --git a/tests/data/BurntSushi/invalid/rrbrace.toml b/tests/data/BurntSushi/invalid/rrbrace.toml new file mode 100644 index 0000000..3a4dee4 --- /dev/null +++ b/tests/data/BurntSushi/invalid/rrbrace.toml @@ -0,0 +1 @@ +[[table] ] diff --git a/tests/data/BurntSushi/invalid/string-bad-byte-escape.toml b/tests/data/BurntSushi/invalid/string-bad-byte-escape.toml new file mode 100644 index 0000000..4c7be59 --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-bad-byte-escape.toml @@ -0,0 +1 @@ +naughty = "\xAg" diff --git a/tests/data/BurntSushi/invalid/string-bad-codepoint.toml b/tests/data/BurntSushi/invalid/string-bad-codepoint.toml new file mode 100644 index 0000000..aa81356 --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-bad-codepoint.toml @@ -0,0 +1 @@ +invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801" \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/string-bad-escape.toml b/tests/data/BurntSushi/invalid/string-bad-escape.toml new file mode 100644 index 0000000..60acb0c --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-bad-escape.toml @@ -0,0 +1 @@ +invalid-escape = "This string has a bad \a escape character." diff --git a/tests/data/BurntSushi/invalid/string-bad-slash-escape.toml b/tests/data/BurntSushi/invalid/string-bad-slash-escape.toml new file mode 100644 index 0000000..154abad --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-bad-slash-escape.toml @@ -0,0 +1 @@ +invalid-escape = "This string has a bad \/ escape character." diff --git a/tests/data/BurntSushi/invalid/string-bad-uni-esc.toml b/tests/data/BurntSushi/invalid/string-bad-uni-esc.toml new file mode 100644 index 0000000..9eae4ab --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-bad-uni-esc.toml @@ -0,0 +1 @@ +str = "val\ue" diff --git a/tests/data/BurntSushi/invalid/string-byte-escapes.toml b/tests/data/BurntSushi/invalid/string-byte-escapes.toml new file mode 100644 index 0000000..e94452a --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-byte-escapes.toml @@ -0,0 +1 @@ +answer = "\x33" diff --git a/tests/data/BurntSushi/invalid/string-no-close.toml b/tests/data/BurntSushi/invalid/string-no-close.toml new file mode 100644 index 0000000..0c292fc --- /dev/null +++ b/tests/data/BurntSushi/invalid/string-no-close.toml @@ -0,0 +1 @@ +no-ending-quote = "One time, at band camp diff --git a/tests/data/BurntSushi/invalid/table-array-implicit.toml b/tests/data/BurntSushi/invalid/table-array-implicit.toml new file mode 100644 index 0000000..05f2507 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-array-implicit.toml @@ -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 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/tests/data/BurntSushi/invalid/table-array-malformed-bracket.toml b/tests/data/BurntSushi/invalid/table-array-malformed-bracket.toml new file mode 100644 index 0000000..39c73b0 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-array-malformed-bracket.toml @@ -0,0 +1,2 @@ +[[albums] +name = "Born to Run" diff --git a/tests/data/BurntSushi/invalid/table-array-malformed-empty.toml b/tests/data/BurntSushi/invalid/table-array-malformed-empty.toml new file mode 100644 index 0000000..a470ca3 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-array-malformed-empty.toml @@ -0,0 +1,2 @@ +[[]] +name = "Born to Run" diff --git a/tests/data/BurntSushi/invalid/table-empty.toml b/tests/data/BurntSushi/invalid/table-empty.toml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-empty.toml @@ -0,0 +1 @@ +[] diff --git a/tests/data/BurntSushi/invalid/table-nested-brackets-close.toml b/tests/data/BurntSushi/invalid/table-nested-brackets-close.toml new file mode 100644 index 0000000..c8b5a67 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-nested-brackets-close.toml @@ -0,0 +1,2 @@ +[a]b] +zyx = 42 diff --git a/tests/data/BurntSushi/invalid/table-nested-brackets-open.toml b/tests/data/BurntSushi/invalid/table-nested-brackets-open.toml new file mode 100644 index 0000000..246d7e9 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-nested-brackets-open.toml @@ -0,0 +1,2 @@ +[a[b] +zyx = 42 diff --git a/tests/data/BurntSushi/invalid/table-whitespace.toml b/tests/data/BurntSushi/invalid/table-whitespace.toml new file mode 100644 index 0000000..79bbcb1 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-whitespace.toml @@ -0,0 +1 @@ +[invalid key] \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/table-with-pound.toml b/tests/data/BurntSushi/invalid/table-with-pound.toml new file mode 100644 index 0000000..0d8edb5 --- /dev/null +++ b/tests/data/BurntSushi/invalid/table-with-pound.toml @@ -0,0 +1,2 @@ +[key#group] +answer = 42 \ No newline at end of file diff --git a/tests/data/BurntSushi/invalid/text-after-array-entries.toml b/tests/data/BurntSushi/invalid/text-after-array-entries.toml new file mode 100644 index 0000000..1a72890 --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-after-array-entries.toml @@ -0,0 +1,4 @@ +array = [ + "Is there life after an array separator?", No + "Entry" +] diff --git a/tests/data/BurntSushi/invalid/text-after-integer.toml b/tests/data/BurntSushi/invalid/text-after-integer.toml new file mode 100644 index 0000000..42de7af --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-after-integer.toml @@ -0,0 +1 @@ +answer = 42 the ultimate answer? diff --git a/tests/data/BurntSushi/invalid/text-after-string.toml b/tests/data/BurntSushi/invalid/text-after-string.toml new file mode 100644 index 0000000..c92a6f1 --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-after-string.toml @@ -0,0 +1 @@ +string = "Is there life after strings?" No. diff --git a/tests/data/BurntSushi/invalid/text-after-table.toml b/tests/data/BurntSushi/invalid/text-after-table.toml new file mode 100644 index 0000000..87da9db --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-after-table.toml @@ -0,0 +1 @@ +[error] this shouldn't be here diff --git a/tests/data/BurntSushi/invalid/text-before-array-separator.toml b/tests/data/BurntSushi/invalid/text-before-array-separator.toml new file mode 100644 index 0000000..9b06a39 --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-before-array-separator.toml @@ -0,0 +1,4 @@ +array = [ + "Is there life before an array separator?" No, + "Entry" +] diff --git a/tests/data/BurntSushi/invalid/text-in-array.toml b/tests/data/BurntSushi/invalid/text-in-array.toml new file mode 100644 index 0000000..a6a6c42 --- /dev/null +++ b/tests/data/BurntSushi/invalid/text-in-array.toml @@ -0,0 +1,5 @@ +array = [ + "Entry 1", + I don't belong, + "Entry 2", +] diff --git a/tests/data/BurntSushi/valid/array-empty.json b/tests/data/BurntSushi/valid/array-empty.json new file mode 100644 index 0000000..2fbf256 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-empty.json @@ -0,0 +1,11 @@ +{ + "thevoid": { "type": "array", "value": [ + {"type": "array", "value": [ + {"type": "array", "value": [ + {"type": "array", "value": [ + {"type": "array", "value": []} + ]} + ]} + ]} + ]} +} diff --git a/tests/data/BurntSushi/valid/array-empty.toml b/tests/data/BurntSushi/valid/array-empty.toml new file mode 100644 index 0000000..fa58dc6 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-empty.toml @@ -0,0 +1 @@ +thevoid = [[[[[]]]]] diff --git a/tests/data/BurntSushi/valid/array-nospaces.json b/tests/data/BurntSushi/valid/array-nospaces.json new file mode 100644 index 0000000..1833d61 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-nospaces.json @@ -0,0 +1,10 @@ +{ + "ints": { + "type": "array", + "value": [ + {"type": "integer", "value": "1"}, + {"type": "integer", "value": "2"}, + {"type": "integer", "value": "3"} + ] + } +} diff --git a/tests/data/BurntSushi/valid/array-nospaces.toml b/tests/data/BurntSushi/valid/array-nospaces.toml new file mode 100644 index 0000000..6618936 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-nospaces.toml @@ -0,0 +1 @@ +ints = [1,2,3] diff --git a/tests/data/BurntSushi/valid/array-string-quote-comma-2.json b/tests/data/BurntSushi/valid/array-string-quote-comma-2.json new file mode 100644 index 0000000..a88eb26 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-quote-comma-2.json @@ -0,0 +1 @@ +{"title": {"type": "array", "value": [{"type": "string", "value": " \", "}]}} diff --git a/tests/data/BurntSushi/valid/array-string-quote-comma-2.toml b/tests/data/BurntSushi/valid/array-string-quote-comma-2.toml new file mode 100644 index 0000000..4758ddc --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-quote-comma-2.toml @@ -0,0 +1 @@ +title = [ " \", ",] diff --git a/tests/data/BurntSushi/valid/array-string-quote-comma.json b/tests/data/BurntSushi/valid/array-string-quote-comma.json new file mode 100644 index 0000000..c6f031f --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-quote-comma.json @@ -0,0 +1,9 @@ +{ + "title": { + "type": "array", + "value": [ + {"type": "string", "value": "Client: \"XXXX\", Job: XXXX"}, + {"type": "string", "value": "Code: XXXX"} + ] + } +} diff --git a/tests/data/BurntSushi/valid/array-string-quote-comma.toml b/tests/data/BurntSushi/valid/array-string-quote-comma.toml new file mode 100644 index 0000000..6b458e1 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-quote-comma.toml @@ -0,0 +1,4 @@ +title = [ +"Client: \"XXXX\", Job: XXXX", +"Code: XXXX" +] diff --git a/tests/data/BurntSushi/valid/array-string-with-comma.json b/tests/data/BurntSushi/valid/array-string-with-comma.json new file mode 100644 index 0000000..d879c4c --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-with-comma.json @@ -0,0 +1,9 @@ +{ + "title": { + "type": "array", + "value": [ + {"type": "string", "value": "Client: XXXX, Job: XXXX"}, + {"type": "string", "value": "Code: XXXX"} + ] + } +} diff --git a/tests/data/BurntSushi/valid/array-string-with-comma.toml b/tests/data/BurntSushi/valid/array-string-with-comma.toml new file mode 100644 index 0000000..655c40e --- /dev/null +++ b/tests/data/BurntSushi/valid/array-string-with-comma.toml @@ -0,0 +1,4 @@ +title = [ +"Client: XXXX, Job: XXXX", +"Code: XXXX" +] diff --git a/tests/data/BurntSushi/valid/array-table-array-string-backslash.json b/tests/data/BurntSushi/valid/array-table-array-string-backslash.json new file mode 100644 index 0000000..4797be9 --- /dev/null +++ b/tests/data/BurntSushi/valid/array-table-array-string-backslash.json @@ -0,0 +1,7 @@ +{ + "foo": [ + { + "bar": {"type": "string", "value": "\"{{baz}}\"" } + } + ] +} diff --git a/tests/data/BurntSushi/valid/array-table-array-string-backslash.toml b/tests/data/BurntSushi/valid/array-table-array-string-backslash.toml new file mode 100644 index 0000000..f0de81e --- /dev/null +++ b/tests/data/BurntSushi/valid/array-table-array-string-backslash.toml @@ -0,0 +1 @@ +foo = [ { bar="\"{{baz}}\""} ] diff --git a/tests/data/BurntSushi/valid/arrays-hetergeneous.json b/tests/data/BurntSushi/valid/arrays-hetergeneous.json new file mode 100644 index 0000000..478fa5c --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays-hetergeneous.json @@ -0,0 +1,19 @@ +{ + "mixed": { + "type": "array", + "value": [ + {"type": "array", "value": [ + {"type": "integer", "value": "1"}, + {"type": "integer", "value": "2"} + ]}, + {"type": "array", "value": [ + {"type": "string", "value": "a"}, + {"type": "string", "value": "b"} + ]}, + {"type": "array", "value": [ + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"} + ]} + ] + } +} diff --git a/tests/data/BurntSushi/valid/arrays-hetergeneous.toml b/tests/data/BurntSushi/valid/arrays-hetergeneous.toml new file mode 100644 index 0000000..a246fcf --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays-hetergeneous.toml @@ -0,0 +1 @@ +mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/tests/data/BurntSushi/valid/arrays-nested.json b/tests/data/BurntSushi/valid/arrays-nested.json new file mode 100644 index 0000000..d21920c --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays-nested.json @@ -0,0 +1,13 @@ +{ + "nest": { + "type": "array", + "value": [ + {"type": "array", "value": [ + {"type": "string", "value": "a"} + ]}, + {"type": "array", "value": [ + {"type": "string", "value": "b"} + ]} + ] + } +} diff --git a/tests/data/BurntSushi/valid/arrays-nested.toml b/tests/data/BurntSushi/valid/arrays-nested.toml new file mode 100644 index 0000000..ce33022 --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays-nested.toml @@ -0,0 +1 @@ +nest = [["a"], ["b"]] diff --git a/tests/data/BurntSushi/valid/arrays.json b/tests/data/BurntSushi/valid/arrays.json new file mode 100644 index 0000000..2445116 --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays.json @@ -0,0 +1,41 @@ +{ + "ints": { + "type": "array", + "value": [ + {"type": "integer", "value": "1"}, + {"type": "integer", "value": "2"}, + {"type": "integer", "value": "3"} + ] + }, + "floats": { + "type": "array", + "value": [ + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"}, + {"type": "float", "value": "3.1"} + ] + }, + "strings": { + "type": "array", + "value": [ + {"type": "string", "value": "a"}, + {"type": "string", "value": "b"}, + {"type": "string", "value": "c"} + ] + }, + "dates": { + "type": "array", + "value": [ + {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, + {"type": "datetime", "value": "1979-05-27T07:32:00Z"}, + {"type": "datetime", "value": "2006-06-01T11:00:00Z"} + ] + }, + "comments": { + "type": "array", + "value": [ + {"type": "integer", "value": "1"}, + {"type": "integer", "value": "2"} + ] + } +} diff --git a/tests/data/BurntSushi/valid/arrays.toml b/tests/data/BurntSushi/valid/arrays.toml new file mode 100644 index 0000000..db1c400 --- /dev/null +++ b/tests/data/BurntSushi/valid/arrays.toml @@ -0,0 +1,12 @@ +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, +] +comments = [ + 1, + 2, #this is ok +] diff --git a/tests/data/BurntSushi/valid/bool.json b/tests/data/BurntSushi/valid/bool.json new file mode 100644 index 0000000..ae368e9 --- /dev/null +++ b/tests/data/BurntSushi/valid/bool.json @@ -0,0 +1,4 @@ +{ + "f": {"type": "bool", "value": "false"}, + "t": {"type": "bool", "value": "true"} +} diff --git a/tests/data/BurntSushi/valid/bool.toml b/tests/data/BurntSushi/valid/bool.toml new file mode 100644 index 0000000..a8a829b --- /dev/null +++ b/tests/data/BurntSushi/valid/bool.toml @@ -0,0 +1,2 @@ +t = true +f = false diff --git a/tests/data/BurntSushi/valid/comments-at-eof.json b/tests/data/BurntSushi/valid/comments-at-eof.json new file mode 100644 index 0000000..458c38a --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-at-eof.json @@ -0,0 +1,3 @@ +{ + "key": {"type": "string", "value": "value"} +} diff --git a/tests/data/BurntSushi/valid/comments-at-eof.toml b/tests/data/BurntSushi/valid/comments-at-eof.toml new file mode 100644 index 0000000..090b474 --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-at-eof.toml @@ -0,0 +1,2 @@ +# This is a full-line comment +key = "value" # This is a comment at the end of a line diff --git a/tests/data/BurntSushi/valid/comments-at-eof2.json b/tests/data/BurntSushi/valid/comments-at-eof2.json new file mode 100644 index 0000000..458c38a --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-at-eof2.json @@ -0,0 +1,3 @@ +{ + "key": {"type": "string", "value": "value"} +} diff --git a/tests/data/BurntSushi/valid/comments-at-eof2.toml b/tests/data/BurntSushi/valid/comments-at-eof2.toml new file mode 100644 index 0000000..026c93a --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-at-eof2.toml @@ -0,0 +1,2 @@ +# This is a full-line comment +key = "value" # This is a comment at the end of a line \ No newline at end of file diff --git a/tests/data/BurntSushi/valid/comments-everywhere.json b/tests/data/BurntSushi/valid/comments-everywhere.json new file mode 100644 index 0000000..e69a2e9 --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-everywhere.json @@ -0,0 +1,12 @@ +{ + "group": { + "answer": {"type": "integer", "value": "42"}, + "more": { + "type": "array", + "value": [ + {"type": "integer", "value": "42"}, + {"type": "integer", "value": "42"} + ] + } + } +} diff --git a/tests/data/BurntSushi/valid/comments-everywhere.toml b/tests/data/BurntSushi/valid/comments-everywhere.toml new file mode 100644 index 0000000..3dca74c --- /dev/null +++ b/tests/data/BurntSushi/valid/comments-everywhere.toml @@ -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/tests/data/BurntSushi/valid/datetime-timezone.json b/tests/data/BurntSushi/valid/datetime-timezone.json new file mode 100644 index 0000000..0b70f14 --- /dev/null +++ b/tests/data/BurntSushi/valid/datetime-timezone.json @@ -0,0 +1,3 @@ +{ + "bestdayever": {"type": "datetime", "value": "2017-06-06T12:34:56-05:00"} +} diff --git a/tests/data/BurntSushi/valid/datetime-timezone.toml b/tests/data/BurntSushi/valid/datetime-timezone.toml new file mode 100644 index 0000000..e59cb84 --- /dev/null +++ b/tests/data/BurntSushi/valid/datetime-timezone.toml @@ -0,0 +1 @@ +bestdayever = 2017-06-06T12:34:56-05:00 diff --git a/tests/data/BurntSushi/valid/datetime.json b/tests/data/BurntSushi/valid/datetime.json new file mode 100644 index 0000000..4cdc000 --- /dev/null +++ b/tests/data/BurntSushi/valid/datetime.json @@ -0,0 +1,5 @@ +{ + "bestdayever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, + "numoffset": {"type": "datetime", "value": "1977-06-28T12:32:00Z"}, + "milliseconds": {"type": "datetime", "value": "1977-12-21T03:32:00.555+00:00"} +} diff --git a/tests/data/BurntSushi/valid/datetime.toml b/tests/data/BurntSushi/valid/datetime.toml new file mode 100644 index 0000000..ee787b7 --- /dev/null +++ b/tests/data/BurntSushi/valid/datetime.toml @@ -0,0 +1,3 @@ +bestdayever = 1987-07-05T17:45:00Z +numoffset = 1977-06-28T07:32:00-05:00 +milliseconds = 1977-12-21T10:32:00.555+07:00 diff --git a/tests/data/BurntSushi/valid/double-quote-escape.json b/tests/data/BurntSushi/valid/double-quote-escape.json new file mode 100644 index 0000000..187c9fd --- /dev/null +++ b/tests/data/BurntSushi/valid/double-quote-escape.json @@ -0,0 +1,6 @@ +{ + "test": { + "type": "string", + "value": "\"one\"" + } +} diff --git a/tests/data/BurntSushi/valid/double-quote-escape.toml b/tests/data/BurntSushi/valid/double-quote-escape.toml new file mode 100644 index 0000000..78e7e72 --- /dev/null +++ b/tests/data/BurntSushi/valid/double-quote-escape.toml @@ -0,0 +1 @@ +test = "\"one\"" diff --git a/tests/data/BurntSushi/valid/empty.json b/tests/data/BurntSushi/valid/empty.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/data/BurntSushi/valid/empty.json @@ -0,0 +1 @@ +{} diff --git a/tests/data/BurntSushi/valid/empty.toml b/tests/data/BurntSushi/valid/empty.toml new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/BurntSushi/valid/escaped-escape.json b/tests/data/BurntSushi/valid/escaped-escape.json new file mode 100644 index 0000000..9db7f8a --- /dev/null +++ b/tests/data/BurntSushi/valid/escaped-escape.json @@ -0,0 +1,3 @@ +{ + "answer": {"type": "string", "value": "\\x64"} +} diff --git a/tests/data/BurntSushi/valid/escaped-escape.toml b/tests/data/BurntSushi/valid/escaped-escape.toml new file mode 100644 index 0000000..d575876 --- /dev/null +++ b/tests/data/BurntSushi/valid/escaped-escape.toml @@ -0,0 +1 @@ +answer = "\\x64" diff --git a/tests/data/BurntSushi/valid/example.json b/tests/data/BurntSushi/valid/example.json new file mode 100644 index 0000000..48aa907 --- /dev/null +++ b/tests/data/BurntSushi/valid/example.json @@ -0,0 +1,14 @@ +{ + "best-day-ever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, + "numtheory": { + "boring": {"type": "bool", "value": "false"}, + "perfection": { + "type": "array", + "value": [ + {"type": "integer", "value": "6"}, + {"type": "integer", "value": "28"}, + {"type": "integer", "value": "496"} + ] + } + } +} diff --git a/tests/data/BurntSushi/valid/example.toml b/tests/data/BurntSushi/valid/example.toml new file mode 100644 index 0000000..8cb02e0 --- /dev/null +++ b/tests/data/BurntSushi/valid/example.toml @@ -0,0 +1,5 @@ +best-day-ever = 1987-07-05T17:45:00Z + +[numtheory] +boring = false +perfection = [6, 28, 496] diff --git a/tests/data/BurntSushi/valid/exponent-part-float.json b/tests/data/BurntSushi/valid/exponent-part-float.json new file mode 100644 index 0000000..c362c6b --- /dev/null +++ b/tests/data/BurntSushi/valid/exponent-part-float.json @@ -0,0 +1,6 @@ +{ + "million": {"type": "float", "value": "1000000"}, + "minustenth": {"type": "float", "value": "-0.1"}, + "beast": {"type": "float", "value": "666"} +} + diff --git a/tests/data/BurntSushi/valid/exponent-part-float.toml b/tests/data/BurntSushi/valid/exponent-part-float.toml new file mode 100644 index 0000000..41bd282 --- /dev/null +++ b/tests/data/BurntSushi/valid/exponent-part-float.toml @@ -0,0 +1,3 @@ +million = 1e6 +minustenth = -1E-1 +beast = 6.66E2 diff --git a/tests/data/BurntSushi/valid/float-exponent.json b/tests/data/BurntSushi/valid/float-exponent.json new file mode 100644 index 0000000..b0d40bd --- /dev/null +++ b/tests/data/BurntSushi/valid/float-exponent.json @@ -0,0 +1,9 @@ +{ + "lower": {"type": "float", "value": "300.0"}, + "upper": {"type": "float", "value": "300.0"}, + "neg": {"type": "float", "value": "0.03"}, + "pos": {"type": "float", "value": "300.0"}, + "zero": {"type": "float", "value": "3.0"}, + "pointlower": {"type": "float", "value": "310.0"}, + "pointupper": {"type": "float", "value": "310.0"} +} diff --git a/tests/data/BurntSushi/valid/float-exponent.toml b/tests/data/BurntSushi/valid/float-exponent.toml new file mode 100644 index 0000000..d0db16f --- /dev/null +++ b/tests/data/BurntSushi/valid/float-exponent.toml @@ -0,0 +1,7 @@ +lower = 3e2 +upper = 3E2 +neg = 3e-2 +pos = 3E+2 +zero = 3e0 +pointlower = 3.1e2 +pointupper = 3.1E2 diff --git a/tests/data/BurntSushi/valid/float-underscore.json b/tests/data/BurntSushi/valid/float-underscore.json new file mode 100644 index 0000000..f86cdd7 --- /dev/null +++ b/tests/data/BurntSushi/valid/float-underscore.json @@ -0,0 +1,5 @@ +{ + "before": {"type": "float", "value": "3141.5927"}, + "after": {"type": "float", "value": "3141.5927"}, + "exponent": {"type": "float", "value": "3e14"} +} diff --git a/tests/data/BurntSushi/valid/float-underscore.toml b/tests/data/BurntSushi/valid/float-underscore.toml new file mode 100644 index 0000000..343353a --- /dev/null +++ b/tests/data/BurntSushi/valid/float-underscore.toml @@ -0,0 +1,3 @@ +before = 3_141.5927 +after = 3141.592_7 +exponent = 3e1_4 diff --git a/tests/data/BurntSushi/valid/float.json b/tests/data/BurntSushi/valid/float.json new file mode 100644 index 0000000..3f69b17 --- /dev/null +++ b/tests/data/BurntSushi/valid/float.json @@ -0,0 +1,6 @@ +{ + "pi": {"type": "float", "value": "3.14"}, + "pospi": {"type": "float", "value": "3.14"}, + "negpi": {"type": "float", "value": "-3.14"}, + "zero-intpart": {"type": "float", "value": "0.123"} +} diff --git a/tests/data/BurntSushi/valid/float.toml b/tests/data/BurntSushi/valid/float.toml new file mode 100644 index 0000000..5f02322 --- /dev/null +++ b/tests/data/BurntSushi/valid/float.toml @@ -0,0 +1,4 @@ +pi = 3.14 +pospi = +3.14 +negpi = -3.14 +zero-intpart = 0.123 diff --git a/tests/data/BurntSushi/valid/implicit-and-explicit-after.json b/tests/data/BurntSushi/valid/implicit-and-explicit-after.json new file mode 100644 index 0000000..374bd09 --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-and-explicit-after.json @@ -0,0 +1,10 @@ +{ + "a": { + "better": {"type": "integer", "value": "43"}, + "b": { + "c": { + "answer": {"type": "integer", "value": "42"} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/implicit-and-explicit-after.toml b/tests/data/BurntSushi/valid/implicit-and-explicit-after.toml new file mode 100644 index 0000000..c0e8865 --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-and-explicit-after.toml @@ -0,0 +1,5 @@ +[a.b.c] +answer = 42 + +[a] +better = 43 diff --git a/tests/data/BurntSushi/valid/implicit-and-explicit-before.json b/tests/data/BurntSushi/valid/implicit-and-explicit-before.json new file mode 100644 index 0000000..374bd09 --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-and-explicit-before.json @@ -0,0 +1,10 @@ +{ + "a": { + "better": {"type": "integer", "value": "43"}, + "b": { + "c": { + "answer": {"type": "integer", "value": "42"} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/implicit-and-explicit-before.toml b/tests/data/BurntSushi/valid/implicit-and-explicit-before.toml new file mode 100644 index 0000000..eee68ff --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-and-explicit-before.toml @@ -0,0 +1,5 @@ +[a] +better = 43 + +[a.b.c] +answer = 42 diff --git a/tests/data/BurntSushi/valid/implicit-groups.json b/tests/data/BurntSushi/valid/implicit-groups.json new file mode 100644 index 0000000..fbae7fc --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-groups.json @@ -0,0 +1,9 @@ +{ + "a": { + "b": { + "c": { + "answer": {"type": "integer", "value": "42"} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/implicit-groups.toml b/tests/data/BurntSushi/valid/implicit-groups.toml new file mode 100644 index 0000000..b6333e4 --- /dev/null +++ b/tests/data/BurntSushi/valid/implicit-groups.toml @@ -0,0 +1,2 @@ +[a.b.c] +answer = 42 diff --git a/tests/data/BurntSushi/valid/inline-table-array.json b/tests/data/BurntSushi/valid/inline-table-array.json new file mode 100644 index 0000000..84df2da --- /dev/null +++ b/tests/data/BurntSushi/valid/inline-table-array.json @@ -0,0 +1,16 @@ +{ + "people": [ + { + "first_name": {"type": "string", "value": "Bruce"}, + "last_name": {"type": "string", "value": "Springsteen"} + }, + { + "first_name": {"type": "string", "value": "Eric"}, + "last_name": {"type": "string", "value": "Clapton"} + }, + { + "first_name": {"type": "string", "value": "Bob"}, + "last_name": {"type": "string", "value": "Seger"} + } + ] +} diff --git a/tests/data/BurntSushi/valid/inline-table-array.toml b/tests/data/BurntSushi/valid/inline-table-array.toml new file mode 100644 index 0000000..3fa60d6 --- /dev/null +++ b/tests/data/BurntSushi/valid/inline-table-array.toml @@ -0,0 +1,3 @@ +people = [{first_name = "Bruce", last_name = "Springsteen"}, + {first_name = "Eric", last_name = "Clapton"}, + {first_name = "Bob", last_name = "Seger"}] diff --git a/tests/data/BurntSushi/valid/inline-table.json b/tests/data/BurntSushi/valid/inline-table.json new file mode 100644 index 0000000..71cc119 --- /dev/null +++ b/tests/data/BurntSushi/valid/inline-table.json @@ -0,0 +1,16 @@ +{ + "name": { + "first": {"type": "string", "value": "Tom"}, + "last": {"type": "string", "value": "Preston-Werner"} + }, + "point": { + "x": {"type": "integer", "value": "1"}, + "y": {"type": "integer", "value": "2"} + }, + "simple": { "a": {"type": "integer", "value": "1"} }, + "str-key": { "a": {"type": "integer", "value": "1"} }, + "table-array": [ + { "a": {"type": "integer", "value": "1"} }, + { "b": {"type": "integer", "value": "2"} } + ] +} diff --git a/tests/data/BurntSushi/valid/inline-table.toml b/tests/data/BurntSushi/valid/inline-table.toml new file mode 100644 index 0000000..257047e --- /dev/null +++ b/tests/data/BurntSushi/valid/inline-table.toml @@ -0,0 +1,5 @@ +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } +simple = { a = 1 } +str-key = { "a" = 1 } +table-array = [{ "a" = 1 }, { "b" = 2 }] diff --git a/tests/data/BurntSushi/valid/integer-underscore.json b/tests/data/BurntSushi/valid/integer-underscore.json new file mode 100644 index 0000000..bb6c3e7 --- /dev/null +++ b/tests/data/BurntSushi/valid/integer-underscore.json @@ -0,0 +1,3 @@ +{ + "kilo": {"type": "integer", "value": "1000"} +} diff --git a/tests/data/BurntSushi/valid/integer-underscore.toml b/tests/data/BurntSushi/valid/integer-underscore.toml new file mode 100644 index 0000000..45eb4f7 --- /dev/null +++ b/tests/data/BurntSushi/valid/integer-underscore.toml @@ -0,0 +1 @@ +kilo = 1_000 diff --git a/tests/data/BurntSushi/valid/integer.json b/tests/data/BurntSushi/valid/integer.json new file mode 100644 index 0000000..543738b --- /dev/null +++ b/tests/data/BurntSushi/valid/integer.json @@ -0,0 +1,6 @@ +{ + "answer": {"type": "integer", "value": "42"}, + "neganswer": {"type": "integer", "value": "-42"}, + "posanswer": {"type": "integer", "value": "42"}, + "zero": {"type": "integer", "value": "0"} +} diff --git a/tests/data/BurntSushi/valid/integer.toml b/tests/data/BurntSushi/valid/integer.toml new file mode 100644 index 0000000..b62de30 --- /dev/null +++ b/tests/data/BurntSushi/valid/integer.toml @@ -0,0 +1,4 @@ +answer = 42 +posanswer = +42 +neganswer = -42 +zero = 0 diff --git a/tests/data/BurntSushi/valid/key-equals-nospace.json b/tests/data/BurntSushi/valid/key-equals-nospace.json new file mode 100644 index 0000000..1f8709a --- /dev/null +++ b/tests/data/BurntSushi/valid/key-equals-nospace.json @@ -0,0 +1,3 @@ +{ + "answer": {"type": "integer", "value": "42"} +} diff --git a/tests/data/BurntSushi/valid/key-equals-nospace.toml b/tests/data/BurntSushi/valid/key-equals-nospace.toml new file mode 100644 index 0000000..560901c --- /dev/null +++ b/tests/data/BurntSushi/valid/key-equals-nospace.toml @@ -0,0 +1 @@ +answer=42 diff --git a/tests/data/BurntSushi/valid/key-numeric.json b/tests/data/BurntSushi/valid/key-numeric.json new file mode 100644 index 0000000..862f8cb --- /dev/null +++ b/tests/data/BurntSushi/valid/key-numeric.json @@ -0,0 +1,3 @@ +{ + "1": {"type": "integer", "value": "1"} +} diff --git a/tests/data/BurntSushi/valid/key-numeric.toml b/tests/data/BurntSushi/valid/key-numeric.toml new file mode 100644 index 0000000..532356f --- /dev/null +++ b/tests/data/BurntSushi/valid/key-numeric.toml @@ -0,0 +1 @@ +1 = 1 diff --git a/tests/data/BurntSushi/valid/key-space.json b/tests/data/BurntSushi/valid/key-space.json new file mode 100644 index 0000000..9d1f769 --- /dev/null +++ b/tests/data/BurntSushi/valid/key-space.json @@ -0,0 +1,3 @@ +{ + "a b": {"type": "integer", "value": "1"} +} diff --git a/tests/data/BurntSushi/valid/key-space.toml b/tests/data/BurntSushi/valid/key-space.toml new file mode 100644 index 0000000..f4f36c4 --- /dev/null +++ b/tests/data/BurntSushi/valid/key-space.toml @@ -0,0 +1 @@ +"a b" = 1 diff --git a/tests/data/BurntSushi/valid/key-special-chars.json b/tests/data/BurntSushi/valid/key-special-chars.json new file mode 100644 index 0000000..3585b2c --- /dev/null +++ b/tests/data/BurntSushi/valid/key-special-chars.json @@ -0,0 +1,5 @@ +{ + "~!@$^&*()_+-`1234567890[]|/?><.,;:'": { + "type": "integer", "value": "1" + } +} diff --git a/tests/data/BurntSushi/valid/key-special-chars.toml b/tests/data/BurntSushi/valid/key-special-chars.toml new file mode 100644 index 0000000..cc572be --- /dev/null +++ b/tests/data/BurntSushi/valid/key-special-chars.toml @@ -0,0 +1 @@ +"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 diff --git a/tests/data/BurntSushi/valid/keys-with-dots.json b/tests/data/BurntSushi/valid/keys-with-dots.json new file mode 100644 index 0000000..d2ee002 --- /dev/null +++ b/tests/data/BurntSushi/valid/keys-with-dots.json @@ -0,0 +1,14 @@ +{ + "plain": {"type": "integer", "value": "1"}, + "with.dot": {"type": "integer", "value": "2"}, + "plain_table": { + "plain": {"type": "integer", "value": "3"}, + "with.dot": {"type": "integer", "value": "4"} + }, + "table": { + "withdot": { + "plain": {"type": "integer", "value": "5"}, + "key.with.dots": {"type": "integer", "value": "6"} + } + } +} \ No newline at end of file diff --git a/tests/data/BurntSushi/valid/keys-with-dots.toml b/tests/data/BurntSushi/valid/keys-with-dots.toml new file mode 100644 index 0000000..2490592 --- /dev/null +++ b/tests/data/BurntSushi/valid/keys-with-dots.toml @@ -0,0 +1,10 @@ +plain = 1 +"with.dot" = 2 + +[plain_table] +plain = 3 +"with.dot" = 4 + +[table.withdot] +plain = 5 +"key.with.dots" = 6 \ No newline at end of file diff --git a/tests/data/BurntSushi/valid/long-float.json b/tests/data/BurntSushi/valid/long-float.json new file mode 100644 index 0000000..8ceed47 --- /dev/null +++ b/tests/data/BurntSushi/valid/long-float.json @@ -0,0 +1,4 @@ +{ + "longpi": {"type": "float", "value": "3.141592653589793"}, + "neglongpi": {"type": "float", "value": "-3.141592653589793"} +} diff --git a/tests/data/BurntSushi/valid/long-float.toml b/tests/data/BurntSushi/valid/long-float.toml new file mode 100644 index 0000000..9558ae4 --- /dev/null +++ b/tests/data/BurntSushi/valid/long-float.toml @@ -0,0 +1,2 @@ +longpi = 3.141592653589793 +neglongpi = -3.141592653589793 diff --git a/tests/data/BurntSushi/valid/long-integer.json b/tests/data/BurntSushi/valid/long-integer.json new file mode 100644 index 0000000..16c331e --- /dev/null +++ b/tests/data/BurntSushi/valid/long-integer.json @@ -0,0 +1,4 @@ +{ + "answer": {"type": "integer", "value": "9223372036854775807"}, + "neganswer": {"type": "integer", "value": "-9223372036854775808"} +} diff --git a/tests/data/BurntSushi/valid/long-integer.toml b/tests/data/BurntSushi/valid/long-integer.toml new file mode 100644 index 0000000..424a13a --- /dev/null +++ b/tests/data/BurntSushi/valid/long-integer.toml @@ -0,0 +1,2 @@ +answer = 9223372036854775807 +neganswer = -9223372036854775808 diff --git a/tests/data/BurntSushi/valid/multiline-string.json b/tests/data/BurntSushi/valid/multiline-string.json new file mode 100644 index 0000000..075bf50 --- /dev/null +++ b/tests/data/BurntSushi/valid/multiline-string.json @@ -0,0 +1,30 @@ +{ + "multiline_empty_one": { + "type": "string", + "value": "" + }, + "multiline_empty_two": { + "type": "string", + "value": "" + }, + "multiline_empty_three": { + "type": "string", + "value": "" + }, + "multiline_empty_four": { + "type": "string", + "value": "" + }, + "equivalent_one": { + "type": "string", + "value": "The quick brown fox jumps over the lazy dog." + }, + "equivalent_two": { + "type": "string", + "value": "The quick brown fox jumps over the lazy dog." + }, + "equivalent_three": { + "type": "string", + "value": "The quick brown fox jumps over the lazy dog." + } +} diff --git a/tests/data/BurntSushi/valid/multiline-string.toml b/tests/data/BurntSushi/valid/multiline-string.toml new file mode 100644 index 0000000..15b1143 --- /dev/null +++ b/tests/data/BurntSushi/valid/multiline-string.toml @@ -0,0 +1,23 @@ +multiline_empty_one = """""" +multiline_empty_two = """ +""" +multiline_empty_three = """\ + """ +multiline_empty_four = """\ + \ + \ + """ + +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.\ + """ diff --git a/tests/data/BurntSushi/valid/nested-inline-table-array.json b/tests/data/BurntSushi/valid/nested-inline-table-array.json new file mode 100644 index 0000000..89cd83e --- /dev/null +++ b/tests/data/BurntSushi/valid/nested-inline-table-array.json @@ -0,0 +1,7 @@ +{ + "a": [ + { + "b": {} + } + ] +} diff --git a/tests/data/BurntSushi/valid/nested-inline-table-array.toml b/tests/data/BurntSushi/valid/nested-inline-table-array.toml new file mode 100644 index 0000000..e1e24f6 --- /dev/null +++ b/tests/data/BurntSushi/valid/nested-inline-table-array.toml @@ -0,0 +1 @@ +a = [ { b = {} } ] diff --git a/tests/data/BurntSushi/valid/newline-crlf.json b/tests/data/BurntSushi/valid/newline-crlf.json new file mode 100644 index 0000000..d32f230 --- /dev/null +++ b/tests/data/BurntSushi/valid/newline-crlf.json @@ -0,0 +1,4 @@ +{ + "os": {"type": "string", "value": "DOS"}, + "newline": {"type": "string", "value": "crlf"} +} diff --git a/tests/data/BurntSushi/valid/newline-crlf.toml b/tests/data/BurntSushi/valid/newline-crlf.toml new file mode 100644 index 0000000..0030024 --- /dev/null +++ b/tests/data/BurntSushi/valid/newline-crlf.toml @@ -0,0 +1,2 @@ +os = "DOS" +newline = "crlf" diff --git a/tests/data/BurntSushi/valid/newline-lf.json b/tests/data/BurntSushi/valid/newline-lf.json new file mode 100644 index 0000000..8114848 --- /dev/null +++ b/tests/data/BurntSushi/valid/newline-lf.json @@ -0,0 +1,4 @@ +{ + "os": {"type": "string", "value": "unix"}, + "newline": {"type": "string", "value": "lf"} +} diff --git a/tests/data/BurntSushi/valid/newline-lf.toml b/tests/data/BurntSushi/valid/newline-lf.toml new file mode 100644 index 0000000..0f3377c --- /dev/null +++ b/tests/data/BurntSushi/valid/newline-lf.toml @@ -0,0 +1,2 @@ +os = "unix" +newline = "lf" diff --git a/tests/data/BurntSushi/valid/raw-multiline-string.json b/tests/data/BurntSushi/valid/raw-multiline-string.json new file mode 100644 index 0000000..b43cce5 --- /dev/null +++ b/tests/data/BurntSushi/valid/raw-multiline-string.json @@ -0,0 +1,14 @@ +{ + "oneline": { + "type": "string", + "value": "This string has a ' quote character." + }, + "firstnl": { + "type": "string", + "value": "This string has a ' quote character." + }, + "multiline": { + "type": "string", + "value": "This string\nhas ' a quote character\nand more than\none newline\nin it." + } +} diff --git a/tests/data/BurntSushi/valid/raw-multiline-string.toml b/tests/data/BurntSushi/valid/raw-multiline-string.toml new file mode 100644 index 0000000..8094c03 --- /dev/null +++ b/tests/data/BurntSushi/valid/raw-multiline-string.toml @@ -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/tests/data/BurntSushi/valid/raw-string.json b/tests/data/BurntSushi/valid/raw-string.json new file mode 100644 index 0000000..693ab9b --- /dev/null +++ b/tests/data/BurntSushi/valid/raw-string.json @@ -0,0 +1,30 @@ +{ + "backspace": { + "type": "string", + "value": "This string has a \\b backspace character." + }, + "tab": { + "type": "string", + "value": "This string has a \\t tab character." + }, + "newline": { + "type": "string", + "value": "This string has a \\n new line character." + }, + "formfeed": { + "type": "string", + "value": "This string has a \\f form feed character." + }, + "carriage": { + "type": "string", + "value": "This string has a \\r carriage return character." + }, + "slash": { + "type": "string", + "value": "This string has a \\/ slash character." + }, + "backslash": { + "type": "string", + "value": "This string has a \\\\ backslash character." + } +} diff --git a/tests/data/BurntSushi/valid/raw-string.toml b/tests/data/BurntSushi/valid/raw-string.toml new file mode 100644 index 0000000..92acd25 --- /dev/null +++ b/tests/data/BurntSushi/valid/raw-string.toml @@ -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/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.json b/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.json new file mode 100644 index 0000000..a6c11ea --- /dev/null +++ b/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.json @@ -0,0 +1,16 @@ +{ + "black":{ + "allow_prereleases":{ + "type":"bool", + "value":"true" + }, + "python":{ + "type":"string", + "value":">3.6" + }, + "version":{ + "type":"string", + "value":">=18.9b0" + } + } + } \ No newline at end of file diff --git a/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.toml b/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.toml new file mode 100644 index 0000000..94e5651 --- /dev/null +++ b/tests/data/BurntSushi/valid/right-curly-brace-after-boolean.toml @@ -0,0 +1 @@ +black = { python=">3.6", version=">=18.9b0", allow_prereleases=true } diff --git a/tests/data/BurntSushi/valid/string-empty.json b/tests/data/BurntSushi/valid/string-empty.json new file mode 100644 index 0000000..6c26d69 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-empty.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "" + } +} diff --git a/tests/data/BurntSushi/valid/string-empty.toml b/tests/data/BurntSushi/valid/string-empty.toml new file mode 100644 index 0000000..e37e681 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-empty.toml @@ -0,0 +1 @@ +answer = "" diff --git a/tests/data/BurntSushi/valid/string-escapes.json b/tests/data/BurntSushi/valid/string-escapes.json new file mode 100644 index 0000000..98e2c82 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-escapes.json @@ -0,0 +1,46 @@ +{ + "backspace": { + "type": "string", + "value": "This string has a \u0008 backspace character." + }, + "tab": { + "type": "string", + "value": "This string has a \u0009 tab character." + }, + "newline": { + "type": "string", + "value": "This string has a \u000A new line character." + }, + "formfeed": { + "type": "string", + "value": "This string has a \u000C form feed character." + }, + "carriage": { + "type": "string", + "value": "This string has a \u000D carriage return character." + }, + "quote": { + "type": "string", + "value": "This string has a \u0022 quote character." + }, + "backslash": { + "type": "string", + "value": "This string has a \u005C backslash character." + }, + "notunicode1": { + "type": "string", + "value": "This string does not have a unicode \\u escape." + }, + "notunicode2": { + "type": "string", + "value": "This string does not have a unicode \u005Cu escape." + }, + "notunicode3": { + "type": "string", + "value": "This string does not have a unicode \\u0075 escape." + }, + "notunicode4": { + "type": "string", + "value": "This string does not have a unicode \\\u0075 escape." + } +} diff --git a/tests/data/BurntSushi/valid/string-escapes.toml b/tests/data/BurntSushi/valid/string-escapes.toml new file mode 100644 index 0000000..6d554e4 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-escapes.toml @@ -0,0 +1,11 @@ +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." +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." diff --git a/tests/data/BurntSushi/valid/string-nl.json b/tests/data/BurntSushi/valid/string-nl.json new file mode 100644 index 0000000..54a4a98 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-nl.json @@ -0,0 +1,22 @@ +{ + "nl_mid": { + "type": "string", + "value": "val\nue" + }, + "nl_end": { + "type": "string", + "value": "value\n" + }, + "lit_nl_end": { + "type": "string", + "value": "value\\n" + }, + "lit_nl_mid": { + "type": "string", + "value": "val\\nue" + }, + "lit_nl_uni": { + "type": "string", + "value": "val\\ue" + } +} diff --git a/tests/data/BurntSushi/valid/string-nl.toml b/tests/data/BurntSushi/valid/string-nl.toml new file mode 100644 index 0000000..1e09a8b --- /dev/null +++ b/tests/data/BurntSushi/valid/string-nl.toml @@ -0,0 +1,6 @@ +nl_mid = "val\nue" +nl_end = """value\n""" + +lit_nl_end = '''value\n''' +lit_nl_mid = 'val\nue' +lit_nl_uni = 'val\ue' diff --git a/tests/data/BurntSushi/valid/string-simple.json b/tests/data/BurntSushi/valid/string-simple.json new file mode 100644 index 0000000..2e05f99 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-simple.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "You are not drinking enough whisky." + } +} diff --git a/tests/data/BurntSushi/valid/string-simple.toml b/tests/data/BurntSushi/valid/string-simple.toml new file mode 100644 index 0000000..e17ade6 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-simple.toml @@ -0,0 +1 @@ +answer = "You are not drinking enough whisky." diff --git a/tests/data/BurntSushi/valid/string-with-pound.json b/tests/data/BurntSushi/valid/string-with-pound.json new file mode 100644 index 0000000..33cdc9c --- /dev/null +++ b/tests/data/BurntSushi/valid/string-with-pound.json @@ -0,0 +1,7 @@ +{ + "pound": {"type": "string", "value": "We see no # comments here."}, + "poundcomment": { + "type": "string", + "value": "But there are # some comments here." + } +} diff --git a/tests/data/BurntSushi/valid/string-with-pound.toml b/tests/data/BurntSushi/valid/string-with-pound.toml new file mode 100644 index 0000000..5fd8746 --- /dev/null +++ b/tests/data/BurntSushi/valid/string-with-pound.toml @@ -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/tests/data/BurntSushi/valid/table-array-implicit.json b/tests/data/BurntSushi/valid/table-array-implicit.json new file mode 100644 index 0000000..32e4640 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-implicit.json @@ -0,0 +1,7 @@ +{ + "albums": { + "songs": [ + {"name": {"type": "string", "value": "Glory Days"}} + ] + } +} diff --git a/tests/data/BurntSushi/valid/table-array-implicit.toml b/tests/data/BurntSushi/valid/table-array-implicit.toml new file mode 100644 index 0000000..3157ac9 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-implicit.toml @@ -0,0 +1,2 @@ +[[albums.songs]] +name = "Glory Days" diff --git a/tests/data/BurntSushi/valid/table-array-many.json b/tests/data/BurntSushi/valid/table-array-many.json new file mode 100644 index 0000000..84df2da --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-many.json @@ -0,0 +1,16 @@ +{ + "people": [ + { + "first_name": {"type": "string", "value": "Bruce"}, + "last_name": {"type": "string", "value": "Springsteen"} + }, + { + "first_name": {"type": "string", "value": "Eric"}, + "last_name": {"type": "string", "value": "Clapton"} + }, + { + "first_name": {"type": "string", "value": "Bob"}, + "last_name": {"type": "string", "value": "Seger"} + } + ] +} diff --git a/tests/data/BurntSushi/valid/table-array-many.toml b/tests/data/BurntSushi/valid/table-array-many.toml new file mode 100644 index 0000000..46062be --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-many.toml @@ -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/tests/data/BurntSushi/valid/table-array-nest.json b/tests/data/BurntSushi/valid/table-array-nest.json new file mode 100644 index 0000000..c117afa --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-nest.json @@ -0,0 +1,18 @@ +{ + "albums": [ + { + "name": {"type": "string", "value": "Born to Run"}, + "songs": [ + {"name": {"type": "string", "value": "Jungleland"}}, + {"name": {"type": "string", "value": "Meeting Across the River"}} + ] + }, + { + "name": {"type": "string", "value": "Born in the USA"}, + "songs": [ + {"name": {"type": "string", "value": "Glory Days"}}, + {"name": {"type": "string", "value": "Dancing in the Dark"}} + ] + } + ] +} diff --git a/tests/data/BurntSushi/valid/table-array-nest.toml b/tests/data/BurntSushi/valid/table-array-nest.toml new file mode 100644 index 0000000..d659a3d --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-nest.toml @@ -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/tests/data/BurntSushi/valid/table-array-one.json b/tests/data/BurntSushi/valid/table-array-one.json new file mode 100644 index 0000000..d75faae --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-one.json @@ -0,0 +1,8 @@ +{ + "people": [ + { + "first_name": {"type": "string", "value": "Bruce"}, + "last_name": {"type": "string", "value": "Springsteen"} + } + ] +} diff --git a/tests/data/BurntSushi/valid/table-array-one.toml b/tests/data/BurntSushi/valid/table-array-one.toml new file mode 100644 index 0000000..cd7e1b6 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-one.toml @@ -0,0 +1,3 @@ +[[people]] +first_name = "Bruce" +last_name = "Springsteen" diff --git a/tests/data/BurntSushi/valid/table-array-table-array.json b/tests/data/BurntSushi/valid/table-array-table-array.json new file mode 100644 index 0000000..e5b7e0a --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-table-array.json @@ -0,0 +1,10 @@ +{ + "a": [ + { + "b": [ + { "c" : { "d": {"type": "string", "value": "val0" } } }, + { "c" : { "d": {"type": "string", "value": "val1" } } } + ] + } + ] +} diff --git a/tests/data/BurntSushi/valid/table-array-table-array.toml b/tests/data/BurntSushi/valid/table-array-table-array.toml new file mode 100644 index 0000000..a07b0c7 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-array-table-array.toml @@ -0,0 +1,7 @@ +[[a]] + [[a.b]] + [a.b.c] + d = "val0" + [[a.b]] + [a.b.c] + d = "val1" diff --git a/tests/data/BurntSushi/valid/table-empty.json b/tests/data/BurntSushi/valid/table-empty.json new file mode 100644 index 0000000..6f3873a --- /dev/null +++ b/tests/data/BurntSushi/valid/table-empty.json @@ -0,0 +1,3 @@ +{ + "a": {} +} diff --git a/tests/data/BurntSushi/valid/table-empty.toml b/tests/data/BurntSushi/valid/table-empty.toml new file mode 100644 index 0000000..8bb6a0a --- /dev/null +++ b/tests/data/BurntSushi/valid/table-empty.toml @@ -0,0 +1 @@ +[a] diff --git a/tests/data/BurntSushi/valid/table-no-eol.json b/tests/data/BurntSushi/valid/table-no-eol.json new file mode 100644 index 0000000..11fa444 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-no-eol.json @@ -0,0 +1 @@ +{ "table": {} } diff --git a/tests/data/BurntSushi/valid/table-no-eol.toml b/tests/data/BurntSushi/valid/table-no-eol.toml new file mode 100644 index 0000000..741b2d1 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-no-eol.toml @@ -0,0 +1 @@ +[table] \ No newline at end of file diff --git a/tests/data/BurntSushi/valid/table-sub-empty.json b/tests/data/BurntSushi/valid/table-sub-empty.json new file mode 100644 index 0000000..9787770 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-sub-empty.json @@ -0,0 +1,3 @@ +{ + "a": { "b": {} } +} diff --git a/tests/data/BurntSushi/valid/table-sub-empty.toml b/tests/data/BurntSushi/valid/table-sub-empty.toml new file mode 100644 index 0000000..70b7fe1 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-sub-empty.toml @@ -0,0 +1,2 @@ +[a] +[a.b] diff --git a/tests/data/BurntSushi/valid/table-whitespace.json b/tests/data/BurntSushi/valid/table-whitespace.json new file mode 100644 index 0000000..3a73ec8 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-whitespace.json @@ -0,0 +1,3 @@ +{ + "valid key": {} +} diff --git a/tests/data/BurntSushi/valid/table-whitespace.toml b/tests/data/BurntSushi/valid/table-whitespace.toml new file mode 100644 index 0000000..daf881d --- /dev/null +++ b/tests/data/BurntSushi/valid/table-whitespace.toml @@ -0,0 +1 @@ +["valid key"] diff --git a/tests/data/BurntSushi/valid/table-with-literal-string.json b/tests/data/BurntSushi/valid/table-with-literal-string.json new file mode 100644 index 0000000..8f006b0 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-literal-string.json @@ -0,0 +1,9 @@ +{ + "a": { + "\"b\"": { + "c": { + "answer": {"type": "integer", "value": "42"} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/table-with-literal-string.toml b/tests/data/BurntSushi/valid/table-with-literal-string.toml new file mode 100644 index 0000000..b81643d --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-literal-string.toml @@ -0,0 +1,4 @@ +['a'] +[a.'"b"'] +[a.'"b"'.c] +answer = 42 diff --git a/tests/data/BurntSushi/valid/table-with-pound.json b/tests/data/BurntSushi/valid/table-with-pound.json new file mode 100644 index 0000000..5e594e4 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-pound.json @@ -0,0 +1,5 @@ +{ + "key#group": { + "answer": {"type": "integer", "value": "42"} + } +} diff --git a/tests/data/BurntSushi/valid/table-with-pound.toml b/tests/data/BurntSushi/valid/table-with-pound.toml new file mode 100644 index 0000000..33f2c4f --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-pound.toml @@ -0,0 +1,2 @@ +["key#group"] +answer = 42 diff --git a/tests/data/BurntSushi/valid/table-with-single-quotes.json b/tests/data/BurntSushi/valid/table-with-single-quotes.json new file mode 100644 index 0000000..fbae7fc --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-single-quotes.json @@ -0,0 +1,9 @@ +{ + "a": { + "b": { + "c": { + "answer": {"type": "integer", "value": "42"} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/table-with-single-quotes.toml b/tests/data/BurntSushi/valid/table-with-single-quotes.toml new file mode 100644 index 0000000..56e52cc --- /dev/null +++ b/tests/data/BurntSushi/valid/table-with-single-quotes.toml @@ -0,0 +1,4 @@ +['a'] +[a.'b'] +[a.'b'.c] +answer = 42 diff --git a/tests/data/BurntSushi/valid/table-without-super.json b/tests/data/BurntSushi/valid/table-without-super.json new file mode 100644 index 0000000..b184d79 --- /dev/null +++ b/tests/data/BurntSushi/valid/table-without-super.json @@ -0,0 +1,9 @@ +{ + "x": { + "y": { + "z": { + "w": {} + } + } + } +} diff --git a/tests/data/BurntSushi/valid/table-without-super.toml b/tests/data/BurntSushi/valid/table-without-super.toml new file mode 100644 index 0000000..73ed68b --- /dev/null +++ b/tests/data/BurntSushi/valid/table-without-super.toml @@ -0,0 +1,5 @@ +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work +[x] # defining a super-table afterwards is ok diff --git a/tests/data/BurntSushi/valid/underscored-float.json b/tests/data/BurntSushi/valid/underscored-float.json new file mode 100644 index 0000000..480109c --- /dev/null +++ b/tests/data/BurntSushi/valid/underscored-float.json @@ -0,0 +1,3 @@ +{ + "electron_mass": {"type": "float", "value": "9.109109383e-31"} +} diff --git a/tests/data/BurntSushi/valid/underscored-float.toml b/tests/data/BurntSushi/valid/underscored-float.toml new file mode 100644 index 0000000..025b02a --- /dev/null +++ b/tests/data/BurntSushi/valid/underscored-float.toml @@ -0,0 +1 @@ +electron_mass = 9_109.109_383e-3_4 diff --git a/tests/data/BurntSushi/valid/underscored-integer.json b/tests/data/BurntSushi/valid/underscored-integer.json new file mode 100644 index 0000000..0804919 --- /dev/null +++ b/tests/data/BurntSushi/valid/underscored-integer.json @@ -0,0 +1,3 @@ +{ + "million": {"type": "integer", "value": "1000000"} +} diff --git a/tests/data/BurntSushi/valid/underscored-integer.toml b/tests/data/BurntSushi/valid/underscored-integer.toml new file mode 100644 index 0000000..6be8b51 --- /dev/null +++ b/tests/data/BurntSushi/valid/underscored-integer.toml @@ -0,0 +1 @@ +million = 1_000_000 diff --git a/tests/data/BurntSushi/valid/unicode-escape.json b/tests/data/BurntSushi/valid/unicode-escape.json new file mode 100644 index 0000000..216f8f7 --- /dev/null +++ b/tests/data/BurntSushi/valid/unicode-escape.json @@ -0,0 +1,4 @@ +{ + "answer4": {"type": "string", "value": "\u03B4"}, + "answer8": {"type": "string", "value": "\u03B4"} +} diff --git a/tests/data/BurntSushi/valid/unicode-escape.toml b/tests/data/BurntSushi/valid/unicode-escape.toml new file mode 100644 index 0000000..82faecb --- /dev/null +++ b/tests/data/BurntSushi/valid/unicode-escape.toml @@ -0,0 +1,2 @@ +answer4 = "\u03B4" +answer8 = "\U000003B4" diff --git a/tests/data/BurntSushi/valid/unicode-literal.json b/tests/data/BurntSushi/valid/unicode-literal.json new file mode 100644 index 0000000..00aa2f8 --- /dev/null +++ b/tests/data/BurntSushi/valid/unicode-literal.json @@ -0,0 +1,3 @@ +{ + "answer": {"type": "string", "value": "δ"} +} diff --git a/tests/data/BurntSushi/valid/unicode-literal.toml b/tests/data/BurntSushi/valid/unicode-literal.toml new file mode 100644 index 0000000..c65723c --- /dev/null +++ b/tests/data/BurntSushi/valid/unicode-literal.toml @@ -0,0 +1 @@ +answer = "δ" diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py new file mode 100644 index 0000000..f4607c5 --- /dev/null +++ b/tests/test_fixtures.py @@ -0,0 +1,36 @@ +import json +from pathlib import Path + +import pytest + +import lil_toml + +DATA_DIR = Path(__file__).parent / "data" / "BurntSushi" + +VALID_FILES = tuple((DATA_DIR / "valid").glob("*.toml")) +VALID_FILES_EXPECTED = tuple( + json.loads(p.with_suffix(".json").read_text("utf-8")) for p in VALID_FILES +) +INVALID_FILES = tuple((DATA_DIR / "invalid").glob("*.toml")) + + +@pytest.mark.parametrize( + "invalid", + INVALID_FILES, + ids=[p.stem for p in INVALID_FILES], +) +def test_invalid(invalid): + toml_str = invalid.read_text(encoding="utf-8") + with pytest.raises(Exception): + lil_toml.loads(toml_str) + + +@pytest.mark.parametrize( + "valid,expected", + zip(VALID_FILES, VALID_FILES_EXPECTED), + ids=[p.stem for p in VALID_FILES], +) +def test_valid(valid, expected): + toml_str = valid.read_text(encoding="utf-8") + actual = lil_toml.loads(toml_str) + assert actual == expected