pax_global_header00006660000000000000000000000064151307022600014506gustar00rootroot0000000000000052 comment=a678e6fdeffa89bd28e4ecc148b926a4e1bbbc7b hukkin-tomli-7940ff4/000077500000000000000000000000001513070226000144665ustar00rootroot00000000000000hukkin-tomli-7940ff4/.bumpversion.cfg000066400000000000000000000007071513070226000176020ustar00rootroot00000000000000[bumpversion] commit = True tag = True tag_name = {new_version} current_version = 2.4.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:src/tomli/__init__.py] search = __version__ = "{current_version}" replace = __version__ = "{new_version}" hukkin-tomli-7940ff4/.flake8000066400000000000000000000003521513070226000156410ustar00rootroot00000000000000[flake8] max-line-length = 88 extend-ignore = # E203: Whitespace before ':' (violates PEP8 and black style) E203, # B042: Requires calling super().__init__ in custom exceptions B042, extend-exclude = */site-packages/* hukkin-tomli-7940ff4/.github/000077500000000000000000000000001513070226000160265ustar00rootroot00000000000000hukkin-tomli-7940ff4/.github/workflows/000077500000000000000000000000001513070226000200635ustar00rootroot00000000000000hukkin-tomli-7940ff4/.github/workflows/tests.yaml000066400000000000000000000104111513070226000221060ustar00rootroot00000000000000name: Tests on: push: branches: [ master ] tags: [ '[0-9]+.[0-9]+.[0-9]+*' ] pull_request: branches: [ master ] env: CIBW_TEST_COMMAND: python -m unittest discover --start-directory {project} CIBW_SKIP: cp38-* cp39-* cp310-* CIBW_ENVIRONMENT_PASS_LINUX: TOMLI_USE_MYPYC FORCE_COLOR: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 jobs: linters: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: '3.11' - name: Install pre-commit run: | pip install pre-commit - name: run linters # pre-commit also runs in pre-commit.ci, but let's have it here too # to block `pypi-publish` job from triggering if pre-commit fails run: | pre-commit run --all-files tests: runs-on: ${{ matrix.os }} strategy: matrix: python-version: ['pypy3.11', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15-dev'] os: [ubuntu-latest, macos-latest, windows-latest] continue-on-error: ${{ matrix.python-version == '3.15-dev' }} steps: - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install package run: | pip install . - name: Test with unittest run: | python -m unittest coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install package and coverage deps run: | pip install . coverage - name: Measure coverage run: | # Coverage should be 100% without external tests rm -rf tests/data/valid/_external/ rm -rf tests/data/invalid/_external/ coverage run -m unittest coverage report --fail-under=100 - name: Report coverage uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} binary-wheels: name: Binary wheels for ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-11-arm') && 'Windows (arm64)' || startsWith(matrix.os, 'windows-') && 'Windows' || endsWith(matrix.os, '-arm') && 'Linux (arm64)' || 'Linux' }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest] steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: '3.x' - name: Switch build backend to setuptools run: | pip install -r scripts/requirements.txt python scripts/use_setuptools.py - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 env: CIBW_ARCHS_MACOS: x86_64 arm64 TOMLI_USE_MYPYC: '1' - uses: actions/upload-artifact@v6 with: name: artifact-binary-${{ matrix.os }} path: wheelhouse/*.whl if-no-files-found: error pure-python-wheel-and-sdist: name: Build a pure Python wheel and source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install build dependencies run: pip install build - name: Build run: python -m build - uses: actions/upload-artifact@v6 with: name: artifact-pure-python path: dist/* if-no-files-found: error allgood: runs-on: ubuntu-latest needs: - tests - coverage - linters - binary-wheels - pure-python-wheel-and-sdist steps: - run: echo "Great success!" pypi-publish: # Only publish if all other jobs succeed needs: [ allgood ] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v7 with: path: dist pattern: artifact-* merge-multiple: true - uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install twine run: | pip install twine - name: Check and publish run: | twine check --strict dist/* twine upload dist/* env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} hukkin-tomli-7940ff4/.gitignore000066400000000000000000000034561513070226000164660ustar00rootroot00000000000000# 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/ hukkin-tomli-7940ff4/.pre-commit-config.yaml000066400000000000000000000037401513070226000207530ustar00rootroot00000000000000repos: - repo: https://github.com/Lucas-C/pre-commit-hooks rev: a30f0d816e5062a67d87c8de753cfe499672b959 # frozen: v1.5.5 hooks: - id: insert-license files: '^src/.+\.py$|^tests/.+\.py$' args: ['--license-filepath', 'LICENSE-HEADER'] - repo: https://github.com/executablebooks/mdformat rev: 2d496dbc18e31b83a1596685347ffe0b6041daf0 # frozen: 1.0.0 hooks: - id: mdformat additional_dependencies: - mdformat-toc - mdformat-gfm - mdformat-black - repo: https://github.com/asottile/yesqa rev: f2ae90cf9e1661ade79d0881186ce4fd7ba6ee79 # frozen: v1.5.0 hooks: - id: yesqa additional_dependencies: - flake8-bugbear - flake8-builtins - flake8-comprehensions - repo: https://github.com/MarcoGorelli/absolufy-imports rev: 1683a63d850e065495c05b771e4a20db010a58e7 # frozen: v0.3.1 hooks: - id: absolufy-imports files: '^src/.+\.py$' args: ['--never', '--application-directories', 'src'] - repo: https://github.com/PyCQA/isort rev: 0a09c783808cfe77bb3269250f663ff733d23302 # frozen: 7.0.0 hooks: - id: isort - repo: https://github.com/psf/black-pre-commit-mirror rev: 831207fd435b47aeffdf6af853097e64322b4d44 # frozen: 25.12.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: check-yaml - repo: https://github.com/pre-commit/pygrep-hooks rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0 hooks: - id: python-use-type-annotations - id: python-check-blanket-noqa - id: python-check-blanket-type-ignore - repo: https://github.com/PyCQA/flake8 rev: d93590f5be797aabb60e3b09f2f52dddb02f349f # frozen: 7.3.0 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-builtins - flake8-comprehensions - repo: https://github.com/pre-commit/mirrors-mypy rev: a66e98df7b4aeeb3724184b332785976d062b92e # frozen: v1.19.1 hooks: - id: mypy args: ["--scripts-are-modules"] hukkin-tomli-7940ff4/CHANGELOG.md000066400000000000000000000125341513070226000163040ustar00rootroot00000000000000# Changelog ## 2.4.0 - Added - TOML v1.1.0 compatibility - Binary wheels for Windows arm64 ## 2.3.0 - Added - Binary wheels for Python 3.14 (also free-threaded) - Performance - Reduced import time ## 2.2.1 - Fixed - Don't attempt to compile binary wheels for Python 3.8, 3.9 and 3.10 where cibuildwheel depends on a conflicting Tomli version ## 2.2.0 - Added - mypyc generated binary wheels for common platforms ## 2.1.0 - Deprecated - Instantiating `TOMLDecodeError` with free-form arguments. `msg`, `doc` and `pos` arguments should be given. - Added - `msg`, `doc`, `pos`, `lineno` and `colno` attributes to `TOMLDecodeError` ## 2.0.2 - Removed - Python 3.7 support - Improved - Make `loads` raise `TypeError` not `AttributeError` on bad input types that do not have the `replace` attribute. Improve error message when `bytes` is received. - Type annotations - Type annotate `load` input as `typing.IO[bytes]` (previously `typing.BinaryIO`). ## 2.0.1 - Improved - Make bundling easier by using relative imports internally and adding license and copyright notice to source files. - Make error messages more uniform - Raise a friendly `TypeError` for wrong file mode - Allow `parse_float` to return objects having the `append` attr - Eagerly raise an error if `parse_float` returns an illegal type - Packaging - Move from `pytest` testing framework to `unittest` and remove `python-dateutil` test dependency. Tests now only require Python interpreter. ## 1.2.3 - Fixed - Backport: Allow lower case "t" and "z" in datetimes ## 2.0.0 - Removed - Python 3.6 support - Support for text file objects as `load` input. Use binary file objects instead. - First argument of `load` and `loads` can no longer be passed by keyword. - Fixed - Allow lower case "t" and "z" in datetimes - Improved - Raise an error when dotted keys define values outside the "current table". Technically speaking TOML v1.0.0 does allow such assignments but that isn't intended by specification writers, and will change in a future specification version (see the [pull request](https://github.com/toml-lang/toml/pull/848)). ## 1.2.2 - Fixed - Illegal characters in error messages were surrounded by two pairs of quotation marks - Improved - `TOMLDecodeError.__module__` is now the public import path (`tomli`) instead of private import path (`tomli._parser`) - Eliminated an import cycle when `typing.TYPE_CHECKING` is `True`. This allows `sphinx-autodoc-typehints` to resolve type annotations. ## 1.2.1 - Fixed - Raise an error if a carriage return (without a following line feed) is found in a multi-line basic string - Type annotations - Type annotate `load` input as `typing.BinaryIO` only to discourage use of deprecated text file objects. - Packaging - Remove legacy `setup.py` from PyPI source distribution. If you're a packager and absolutely need this file, please create an issue. ## 1.2.0 - Deprecated - Text file objects as input to `load`. Binary file objects should be used instead to avoid opening a TOML file with universal newlines or with an encoding other than UTF-8. ## 1.1.0 - Added - `load` can now take a binary file object ## 1.0.4 - Performance - Minor boost (~4%) ## 1.0.3 - Fixed - Raise `TOMLDecodeError` instead of `ValueError` when parsing dates and datetimes that pass the regex check but don't correspond to a valid date or datetime. - Performance - Improved multiline literal string parsing performance ## 1.0.2 - Performance - Minor boost (~4%) ## 1.0.1 - Performance - A significant boost ## 1.0.0 - Fixed - Raise `TOMLDecodeError` instead of `KeyError` when overwriting implicitly in an inline table ## 0.2.10 - Fixed - Raise `TOMLDecodeError` if overwriting nested inline tables from the parent inline - Raise `TOMLDecodeError` if escaped Unicode character is not a Unicode scalar value - Performance - Increased parsing speed of single line basic strings, and multi-line literal and basic strings ## 0.2.9 - Fixed - `TOMLDecodeError` now raised when opening a table implicitly created by a key/value pair - Don't error when two array-of-tables items open a subtable with the same name - Don't error when opening parent table of an already defined array-of-tables item ## 0.2.8 - Performance - Significant boost to comment parsing speed ## 0.2.7 - Added - Improved `TOMLDecodeError` error messages. Line and column are included when applicable. ## 0.2.6 - Performance - Over 5% boost ## 0.2.5 - Fixed - Made exception type `TOMLDecodeError` when overwriting a value with a deeply nested table ## 0.2.4 - Fixed - `TOMLDecodeError` is now raised when attempting to overwrite a value in an inline table's or array's namespace with a table definition ## 0.2.3 - Fixed - Error type was not TOMLDecodeError in some obscure cases ## 0.2.2 - Added - `tomli.load` for parsing IO streams returned by `open()` - `parse_float` keyword argument to `tomli.loads`. Allows parsing TOML floats to a non-float type in Python. ## 0.2.1 - Fixed - `TOMLDecodeError` is now raised for duplicate keys in inline tables, as opposed to silently overriding the previous value ## 0.2.0 - Changed - Project name to Tomli - Performance - A performance boost ## 0.1.0 - Added - `tomli.loads` for parsing TOML strings - `tomli.TOMLDecodeError` that is raised for parse errors hukkin-tomli-7940ff4/LICENSE000066400000000000000000000020601513070226000154710ustar00rootroot00000000000000MIT 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. hukkin-tomli-7940ff4/LICENSE-HEADER000066400000000000000000000001711513070226000164200ustar00rootroot00000000000000SPDX-License-Identifier: MIT SPDX-FileCopyrightText: 2021 Taneli Hukkinen Licensed to PSF under a Contributor Agreement. hukkin-tomli-7940ff4/MANIFEST.in000066400000000000000000000000151513070226000162200ustar00rootroot00000000000000prune tests/ hukkin-tomli-7940ff4/README.md000066400000000000000000000230001513070226000157400ustar00rootroot00000000000000[![Build Status](https://github.com/hukkin/tomli/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/hukkin/tomli/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush) [![codecov.io](https://codecov.io/gh/hukkin/tomli/branch/master/graph/badge.svg)](https://codecov.io/gh/hukkin/tomli) [![PyPI version](https://img.shields.io/pypi/v/tomli)](https://pypi.org/project/tomli) # Tomli > A lil' TOML parser **Table of Contents** *generated with [mdformat-toc](https://github.com/hukkin/mdformat-toc)* - [Intro](#intro) - [Installation](#installation) - [Usage](#usage) - [Parse a TOML string](#parse-a-toml-string) - [Parse a TOML file](#parse-a-toml-file) - [Handle invalid TOML](#handle-invalid-toml) - [Construct `decimal.Decimal`s from TOML floats](#construct-decimaldecimals-from-toml-floats) - [Building a `tomli`/`tomllib` compatibility layer](#building-a-tomlitomllib-compatibility-layer) - [FAQ](#faq) - [Why this parser?](#why-this-parser) - [Is comment preserving round-trip parsing supported?](#is-comment-preserving-round-trip-parsing-supported) - [Is there a `dumps`, `write` or `encode` function?](#is-there-a-dumps-write-or-encode-function) - [How do TOML types map into Python types?](#how-do-toml-types-map-into-python-types) - [Performance](#performance) - [Pure Python](#pure-python) - [Mypyc generated wheel](#mypyc-generated-wheel) ## Intro Tomli is a Python library for parsing [TOML](https://toml.io). Version 2.4.0 and later are compatible with [TOML v1.1.0](https://toml.io/en/v1.1.0). Older versions are [TOML v1.0.0](https://toml.io/en/v1.0.0) compatible. A version of Tomli, the `tomllib` module, was added to the standard library in Python 3.11 via [PEP 680](https://www.python.org/dev/peps/pep-0680/). Tomli continues to provide a backport on PyPI for Python versions where the standard library module is not available and that have not yet reached their end-of-life. Tomli uses [mypyc](https://github.com/mypyc/mypyc) to generate binary wheels for most of the widely used platforms, so Python 3.11+ users may prefer it over `tomllib` for improved performance. Pure Python wheels are available on any platform and should perform the same as `tomllib`. ## Installation ```bash pip install tomli ``` ## Usage ### Parse a TOML string ```python import tomli toml_str = """ [[players]] name = "Lehtinen" number = 26 [[players]] name = "Numminen" number = 27 """ toml_dict = tomli.loads(toml_str) assert toml_dict == { "players": [{"name": "Lehtinen", "number": 26}, {"name": "Numminen", "number": 27}] } ``` ### Parse a TOML file ```python import tomli with open("path_to_file/conf.toml", "rb") as f: toml_dict = tomli.load(f) ``` The file must be opened in binary mode (with the `"rb"` flag). Binary mode will enforce decoding the file as UTF-8 with universal newlines disabled, both of which are required to correctly parse TOML. ### Handle invalid TOML ```python import tomli try: toml_dict = tomli.loads("]] this is invalid TOML [[") except tomli.TOMLDecodeError: print("Yep, definitely not valid.") ``` Note that error messages are considered informational only. They should not be assumed to stay constant across Tomli versions. ### Construct `decimal.Decimal`s from TOML floats ```python from decimal import Decimal import tomli toml_dict = tomli.loads("precision-matters = 0.982492", parse_float=Decimal) assert isinstance(toml_dict["precision-matters"], Decimal) assert toml_dict["precision-matters"] == Decimal("0.982492") ``` Note that `decimal.Decimal` can be replaced with another callable that converts a TOML float from string to a Python type. The `decimal.Decimal` is, however, a practical choice for use cases where float inaccuracies can not be tolerated. Illegal types are `dict` and `list`, and their subtypes. A `ValueError` will be raised if `parse_float` produces illegal types. ### Building a `tomli`/`tomllib` compatibility layer Python versions 3.11+ ship with a version of Tomli: the `tomllib` standard library module. To build code that uses the standard library if available, but still works seamlessly with Python 3.6+, do the following. Instead of a hard Tomli dependency, use the following [dependency specifier](https://packaging.python.org/en/latest/specifications/dependency-specifiers/) to only require Tomli when the standard library module is not available: ``` tomli >= 1.1.0 ; python_version < "3.11" ``` Then, in your code, import a TOML parser using the following fallback mechanism: ```python import sys if sys.version_info >= (3, 11): import tomllib else: import tomli as tomllib tomllib.loads("['This parses fine with Python 3.6+']") ``` ## FAQ ### Why this parser? - it's lil' - pure Python with zero dependencies - the fastest pure Python parser [\*](#pure-python): 18x as fast as [tomlkit](https://pypi.org/project/tomlkit/), 2.1x as fast as [toml](https://pypi.org/project/toml/) - outputs [basic data types](#how-do-toml-types-map-into-python-types) only - 100% spec compliant: passes all tests in [toml-lang/toml-test](https://github.com/toml-lang/toml-test) test suite - thoroughly tested: 100% branch coverage ### Is comment preserving round-trip parsing supported? No. The `tomli.loads` function returns a plain `dict` that is populated with builtin types and types from the standard library only. Preserving comments requires a custom type to be returned so will not be supported, at least not by the `tomli.loads` and `tomli.load` functions. Look into [TOML Kit](https://github.com/sdispater/tomlkit) if preservation of style is what you need. ### Is there a `dumps`, `write` or `encode` function? [Tomli-W](https://github.com/hukkin/tomli-w) is the write-only counterpart of Tomli, providing `dump` and `dumps` functions. The core library does not include write capability, as most TOML use cases are read-only, and Tomli intends to be minimal. ### How do TOML types map into Python types? | TOML type | Python type | Details | | ---------------- | ------------------- | ------------------------------------------------------------ | | Document Root | `dict` | | | Key | `str` | | | String | `str` | | | Integer | `int` | | | Float | `float` | | | Boolean | `bool` | | | Offset Date-Time | `datetime.datetime` | `tzinfo` attribute set to an instance of `datetime.timezone` | | Local Date-Time | `datetime.datetime` | `tzinfo` attribute set to `None` | | Local Date | `datetime.date` | | | Local Time | `datetime.time` | | | Array | `list` | | | Table | `dict` | | | Inline Table | `dict` | | ## Performance The `benchmark/` folder in this repository contains a performance benchmark for comparing the various Python TOML parsers. Below are the results for commit [0724e2a](https://github.com/hukkin/tomli/tree/0724e2ab1858da7f5e05a9bffdb24c33589d951c). ### Pure Python ```console foo@bar:~/dev/tomli$ python --version Python 3.12.7 foo@bar:~/dev/tomli$ pip freeze attrs==21.4.0 click==8.1.7 pytomlpp==1.0.13 qtoml==0.3.1 rtoml==0.11.0 toml==0.10.2 tomli @ file:///home/foo/dev/tomli tomlkit==0.13.2 foo@bar:~/dev/tomli$ python benchmark/run.py Parsing data.toml 5000 times: ------------------------------------------------------ parser | exec time | performance (more is better) -----------+------------+----------------------------- rtoml | 0.647 s | baseline (100%) pytomlpp | 0.891 s | 72.62% tomli | 3.14 s | 20.56% toml | 6.69 s | 9.67% qtoml | 8.27 s | 7.82% tomlkit | 56.1 s | 1.15% ``` ### Mypyc generated wheel ```console foo@bar:~/dev/tomli$ python benchmark/run.py Parsing data.toml 5000 times: ------------------------------------------------------ parser | exec time | performance (more is better) -----------+------------+----------------------------- rtoml | 0.668 s | baseline (100%) pytomlpp | 0.893 s | 74.81% tomli | 1.96 s | 34.18% toml | 6.64 s | 10.07% qtoml | 8.26 s | 8.09% tomlkit | 52.9 s | 1.26% ``` hukkin-tomli-7940ff4/benchmark/000077500000000000000000000000001513070226000164205ustar00rootroot00000000000000hukkin-tomli-7940ff4/benchmark/LICENSE000066400000000000000000000021501513070226000174230ustar00rootroot00000000000000MIT License Copyright (c) 2020 Bob Fang (bob.fang.london@gmail.com) 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. hukkin-tomli-7940ff4/benchmark/README.md000066400000000000000000000006261513070226000177030ustar00rootroot00000000000000# Benchmark ## Acknowledgments This benchmark was shamelessly copied from [pytomlpp](https://github.com/bobfang1992/pytomlpp/tree/e6b03726f8347c6a6757f520ad1b5fab68ed8534/benchmark) repository and edited. Credit goes to the authors of that project. ## Running ### Against the local Tomli state ```bash tox -e benchmark ``` ### Against the latest Tomli PyPI release ```bash tox -e benchmark-pypi ``` hukkin-tomli-7940ff4/benchmark/data.toml000066400000000000000000000076651513070226000202440ustar00rootroot00000000000000addition-used = false afraid-boiling-draconian = 1916-12-15T11:26:42+11:26 boiling-whip = 12:23:17.000129 charming = 16771 close-unbecoming = 14:49:02 contain-terrible-neck = 1928-11-07T06:30:56 creature = 0.4857 crowded-profuse-capable = 1932-05-28 deserted-cross-creature = 1931-12-26T04:31:04 deserted-heavy = [ 2014-02-08, 1984-03-16, 1910-08-05 ] fabulous = 0.3388 ghost-birds-legal = 1989-09-02 grandfather-weary = 10216 haircut-dreary-broken = 'unadvised rejoice lewd crime grandfather rice imperfect' harm-snow = 0.6724 leather-aromatic-rabbit = false license-harm = 1987-08-15T15:30:51+03:24 naughty-self-close = 1916-09-21T01:53:27-02:59 neck = 29653 neck-crime-wistful = 1998-12-07 rest-afraid = [ 1912-06-23T07:00:07-07:46, # this is a datetime 1910-11-17T13:10:34, # pretty sure this is also a datetime 2014-08-03T04:37:12-06:36, # and this 1966-11-22T18:08:23+06:10, # and this 1985-03-01T08:11:38, # what about this? 1976-09-04T20:46:46+00:29, # yes that also 1964-05-18T20:13:27-01:25, # ... 1961-10-14T11:03:51.011555+06:23, 2005-07-13T02:57:15-01:46, # wonder how many comments there are typically in 2007-02-01T17:09:54-08:45, # a TOML file of this size 1952-03-06T09:15:04+01:44, 1962-12-25T23:00:11+04:28 ] rotten-best = 0.0325 run-curious = true run-meaty = 04:40:20.003312 scintillating-cream = 0.2604 sisters-playground = 'week spiritual pause insidious uptight' spiritual-borrow-messy = 16:49:32 surprise-jail-babies = 2008-01-01 title-unbiased = 1958-10-08 unbecoming-scene-lewd = true worried-spicy = 23:03:54 [contain] ghost = 0.2471 tank-lackadaisical = 1945-02-18T22:22:27+01:41 [contain.righteous-imperfect-remarkable] ticket = 0.2412 voyage = 'prefer silky night draconian three dreary decisive' wilderness-draconian = 04:58:17 [contain.righteous-imperfect-remarkable.deeply-night-gold] legal = 1981-07-04 righteous = [ false, true, false, false, true ] wilderness = 1900-12-24 [crime] boiling-excuse-incandescent = 31173 flat-rejoice = 0.8682 furtive = 6866 heavy-memory = 5545 lackadaisical-terrible-overjoyed = [ 'harm acceptable naughty pause', 'page anxious threatening lewd' ] reject-aromatic = [ false, true, true, true, false, true ] reject-naughty = 11229 scintillating-bake-harm = 0.8258 [license-bat] adorable-blind-string = 1961-08-14 bat = 1939-10-28 blind-wilderness = 2004-07-14 [rapid] borrow = true jail-weary-furtive = 'room' protective-sulky = 4737 room-decisive-unbiased = 1998-11-01T12:23:58 soap = 1985-05-06 sprout-rich = 0.6026 [rapid.clean-leather] blood-snow-mark = true equable = 0.2923 fabulous = 1979-07-24T00:53:39+06:22 glorious-threatening = true lewd-dull = 02:40:53.027288 [run-overjoyed] creature-cheerful = 11071 respect-history-anxious = 0.4637 vessel = 'curious' [inline-tables] table1 ={ the-text-in-this = 'file is weeiiird' , autogenerated-perhaps= 1199999 , subtableee = {blii=false}} table2 = { arr = [ { id = 0 }, { id = 1}, { id = 2} ] } [[dynamic-arrays.products]] name = "juusto" [[dynamic-arrays.products]] name = "tee \t\t kannu" [[dynamic-arrays.products]] name = "\n\nkahvi" [[dynamic-arrays.products]] name = "\"riisi\"" [[dynamic-arrays.products]] name = "puuro \\ riisipuuro" # Fusce sit amet risus vel sapien vestibulum interdum. Aliquam finibus # finibus nibh, sed mattis nulla lacinia in. Nunc ac volutpat massa, # at fringilla dui. In dignissim pellentesque luctus. Cras ac ex metus. # Duis ut molestie augue. Donec vitae nulla massa. Sed blandit diam sit # amet mauris posuere consectetur. [multiline-strings] literal-str = ''' Liirum laarum liirum laarum. Liirum laarum liirum laarum. Liirum laarum liirum laarum. ''' basic-str = """\ Escape whitespace. \ Liirum laarum liirum laarum.\ueeee\U000eeeee\u1234 """ hukkin-tomli-7940ff4/benchmark/requirements.txt000066400000000000000000000002771513070226000217120ustar00rootroot00000000000000# NOTE # Tomli itself is not included here because tox is used to read # this file and install the deps, and it handles the Tomli # installation separately. pytomlpp toml tomlkit qtoml rtoml hukkin-tomli-7940ff4/benchmark/run.py000066400000000000000000000044441513070226000176040ustar00rootroot00000000000000from __future__ import annotations from collections.abc import Callable from pathlib import Path import timeit import pytomlpp import qtoml import rtoml import toml import tomlkit import tomli def benchmark( name: str, run_count: int, func: Callable, col_width: tuple, compare_to: float | None = None, ) -> float: placeholder = "Running..." print(f"{name:>{col_width[0]}} | {placeholder}", end="", flush=True) time_taken = timeit.timeit(func, number=run_count) print("\b" * len(placeholder), end="") time_suffix = " s" print(f"{time_taken:{col_width[1]-len(time_suffix)}.3g}{time_suffix}", end="") if compare_to is None: print(" | baseline (100%)", end="") else: delta = compare_to / time_taken print(f" | {delta:.2%}", end="") print() return time_taken def run(run_count: int) -> None: data_path = Path(__file__).parent / "data.toml" test_data = data_path.read_bytes().decode() # qtoml has a bug making it crash without this newline normalization test_data = test_data.replace("\r\n", "\n") col_width = (10, 10, 28) col_head = ("parser", "exec time", "performance (more is better)") print(f"Parsing data.toml {run_count} times:") print("-" * col_width[0] + "---" + "-" * col_width[1] + "---" + col_width[2] * "-") print( f"{col_head[0]:>{col_width[0]}} | {col_head[1]:>{col_width[1]}} | {col_head[2]}" ) print("-" * col_width[0] + "-+-" + "-" * col_width[1] + "-+-" + col_width[2] * "-") # fmt: off baseline = benchmark("rtoml", run_count, lambda: rtoml.loads(test_data), col_width) # noqa: E501 benchmark("pytomlpp", run_count, lambda: pytomlpp.loads(test_data), col_width, compare_to=baseline) # noqa: E501 benchmark("tomli", run_count, lambda: tomli.loads(test_data), col_width, compare_to=baseline) # noqa: E501 benchmark("toml", run_count, lambda: toml.loads(test_data), col_width, compare_to=baseline) # noqa: E501 benchmark("qtoml", run_count, lambda: qtoml.loads(test_data), col_width, compare_to=baseline) # noqa: E501 benchmark("tomlkit", run_count, lambda: tomlkit.parse(test_data), col_width, compare_to=baseline) # noqa: E501 # fmt: on if __name__ == "__main__": run(5000) hukkin-tomli-7940ff4/fuzzer/000077500000000000000000000000001513070226000160135ustar00rootroot00000000000000hukkin-tomli-7940ff4/fuzzer/fuzz.py000066400000000000000000000041241513070226000173640ustar00rootroot00000000000000import atheris with atheris.instrument_imports(): from math import isnan import sys import warnings import tomli_w import tomli # Disable any caching used so that the same lines of code run # on a given input consistently. tomli._re.cached_tz = tomli._re.cached_tz.__wrapped__ # Suppress all warnings. warnings.simplefilter("ignore") def test_one_input(input_bytes: bytes) -> None: # We need a Unicode string, not bytes fdp = atheris.FuzzedDataProvider(input_bytes) data = fdp.ConsumeUnicode(sys.maxsize) try: toml_obj = tomli.loads(data) except (tomli.TOMLDecodeError, RecursionError): return except BaseException: print_err(data) raise try: recovered_data = tomli_w.dumps(toml_obj) except RecursionError: return except BaseException: print_err(data) raise roundtripped_obj = tomli.loads(recovered_data) normalize_toml_obj(roundtripped_obj) normalize_toml_obj(toml_obj) if roundtripped_obj != toml_obj: sys.stderr.write( f"Original dict:\n{toml_obj}\nRoundtripped dict:\n{roundtripped_obj}\n" ) sys.stderr.flush() print_err(data) raise Exception("Dicts not equal after roundtrip") def print_err(data): codepoints = [hex(ord(x)) for x in data] sys.stderr.write(f"Input was {type(data)}:\n{data}\nCodepoints:\n{codepoints}\n") sys.stderr.flush() def normalize_toml_obj(toml_obj: dict) -> None: """Make NaNs equal when compared (without using recursion).""" to_process = [toml_obj] while to_process: cont = to_process.pop() for k, v in cont.items() if isinstance(cont, dict) else enumerate(cont): if isinstance(v, float) and isnan(v): cont[k] = "nan" elif isinstance(v, (dict, list)): to_process.append(v) def main(): # For possible options, see https://llvm.org/docs/LibFuzzer.html#options fuzzer_options = sys.argv atheris.Setup(fuzzer_options, test_one_input) atheris.Fuzz() if __name__ == "__main__": main() hukkin-tomli-7940ff4/fuzzer/requirements.txt000066400000000000000000000001011513070226000212670ustar00rootroot00000000000000# sudo apt-get install clang wheel atheris==2.0.7 tomli_w>=0.2.2 hukkin-tomli-7940ff4/profiler/000077500000000000000000000000001513070226000163105ustar00rootroot00000000000000hukkin-tomli-7940ff4/profiler/profiler_script.py000066400000000000000000000006131513070226000220700ustar00rootroot00000000000000"""A script for profiling. To generate and read results: - `tox -e profile` - `firefox .tox/prof/output.svg` """ from pathlib import Path import tomli benchmark_toml = ( (Path(__file__).parent.parent / "benchmark" / "data.toml").read_bytes().decode() ) # Run this a few times to emphasize over imports and other overhead above. for _ in range(1000): tomli.loads(benchmark_toml) hukkin-tomli-7940ff4/profiler/requirements.txt000066400000000000000000000000121513070226000215650ustar00rootroot00000000000000gprof2dot hukkin-tomli-7940ff4/pyproject.toml000066400000000000000000000117321513070226000174060ustar00rootroot00000000000000[build-system] requires = ["flit_core>=3.12,<4"] build-backend = "flit_core.buildapi" [project] name = "tomli" version = "2.4.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT description = "A lil' TOML parser" authors = [ { name = "Taneli Hukkinen", email = "hukkin@users.noreply.github.com" }, ] license = "MIT" license-files = ["LICENSE"] requires-python = ">=3.8" readme = "README.md" classifiers = [ "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] keywords = ["toml"] [project.urls] "Homepage" = "https://github.com/hukkin/tomli" "Changelog" = "https://github.com/hukkin/tomli/blob/master/CHANGELOG.md" [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 = ["tomli", "tests"] # Settings for Black compatibility profile = "black" [tool.tox] requires = ["tox>=4.21.1"] # Only run unittest envs when no args given to tox env_list = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] [tool.tox.env_run_base] description = "run tests against a built package under {base_python}" pass_env = ["TOMLI_USE_MYPYC"] commands = [ ["python", "-m", "unittest", { replace = "posargs", extend = true }], ] [tool.tox.env."profile"] description = "run profiler (use e.g. `firefox .tox/prof/output.svg` to open)" deps = [ "-r profiler/requirements.txt", ] allowlist_externals = [ "mkdir", "dot", ] commands = [ ["mkdir", "-p", "{toxworkdir}/prof"], ["python", "-m", "cProfile", "-o", "{toxworkdir}/prof/output.pstats", "profiler/profiler_script.py"], ["gprof2dot", "-f", "pstats", "-o", "{toxworkdir}/prof/output.dot", "{toxworkdir}/prof/output.pstats"], ["dot", "-Tsvg", "-o", "{toxworkdir}/prof/output.svg", "{toxworkdir}/prof/output.dot"], ["python", "-c", 'import pathlib; print("profiler svg output under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "prof" / "output.svg"))'], ] [tool.tox.env."pre-commit"] description = "run linters" skip_install = true deps = ["pre-commit"] commands = [ ["pre-commit", "run", { replace = "posargs", default = ["--all"], extend = true }], ] [tool.tox.env."benchmark"] description = "run the benchmark script against a local Tomli version" deps = ["-r benchmark/requirements.txt"] commands = [ ["python", "-c", "import datetime; print(datetime.date.today())"], ["python", "--version"], ["python", "benchmark/run.py"], ] [tool.tox.env."benchmark-pypi"] description = "run the benchmark script against the latest Tomli in PyPI" skip_install = true deps = [ "tomli", "-r benchmark/requirements.txt", ] commands = [ ["python", "-c", "import datetime; print(datetime.date.today())"], ["python", "--version"], ["python", "benchmark/run.py"], ] [tool.tox.env."benchmark-import"] description = "Measure module import times. Tox sends Python output to stderr, so to filter use e.g. `tox -e benchmark-import 2> >(grep tomli)`." commands = [ ["python", "-X", "importtime", "-c", "import tomli"], ] [tool.tox.env."fuzz"] description = 'run the fuzzer against a local Tomli version (needs "apt install clang")' deps = [ "-r fuzzer/requirements.txt", ] allowlist_externals = [ "mkdir", "cp", ] commands = [ # Create a folder for persistent corpus and use benchmark data as initial seed ["mkdir", "-p", "{toxworkdir}/fuzzer-corpus"], ["cp", "-n", "benchmark/data.toml", "{toxworkdir}/fuzzer-corpus/data.toml"], # Run fuzzer ["python", "fuzzer/fuzz.py", "{toxworkdir}/fuzzer-corpus", { replace = "posargs", default = ["-len_control=10000"], extend = true }], ] [tool.coverage.run] branch = true source = ['tomli'] [tool.coverage.report] # Regexes for lines to exclude from consideration exclude_lines = [ # Re-enable the standard pragma (with extra strictness) '# pragma: no cover\b', # Code for static type checkers 'if TYPE_CHECKING:', # Scripts 'if __name__ == .__main__.:', ] [tool.mypy] show_error_codes = true warn_unreachable = true strict = true strict_bytes = true local_partial_types = true # Disabling incremental mode is required for `warn_unused_configs = true` # (implied by `strict = true`) to work incremental = false enable_error_code = ["ignore-without-code"] [[tool.mypy.overrides]] module = "tests.*" disallow_untyped_defs = false [[tool.mypy.overrides]] # This matches `benchmark/run.py`. Since benchmark/ is # not a package, we use the module name here. module = "run" ignore_errors = true [[tool.mypy.overrides]] # This matches `fuzzer/fuzz.py`. module = "fuzz" ignore_errors = true hukkin-tomli-7940ff4/scripts/000077500000000000000000000000001513070226000161555ustar00rootroot00000000000000hukkin-tomli-7940ff4/scripts/mypyc_tox000077500000000000000000000020151513070226000201340ustar00rootroot00000000000000#!/usr/bin/env python3 """A tox wrapper to make it build Tomli with setuptools + mypyc. Run this instead of tox. For example: `./scripts/mypyc_tox -e benchmark` All arguments are passed to tox. Prior to running tox, this edits the [build-system] table in pyproject.toml to support mypyc builds. The change is reverted before exiting. This also sets the `TOMLI_USE_MYPYC=1` environment variable that setup.py reads to enable mypyc. """ import os from pathlib import Path import shutil import subprocess import sys from use_setuptools import use_setuptools project_root = Path(__file__).parent.parent pyproject_path = project_root / "pyproject.toml" backup_path = project_root / ".backup.pyproject.toml" tox_env_vars = os.environ.copy() tox_env_vars["TOMLI_USE_MYPYC"] = "1" shutil.copy2(pyproject_path, backup_path) try: use_setuptools() result = subprocess.run(["tox", *sys.argv[1:]], env=tox_env_vars) raise SystemExit(result.returncode) finally: shutil.copy2(backup_path, pyproject_path) backup_path.unlink() hukkin-tomli-7940ff4/scripts/requirements.txt000066400000000000000000000000101513070226000214300ustar00rootroot00000000000000tomli-w hukkin-tomli-7940ff4/scripts/use_setuptools.py000066400000000000000000000012061513070226000216230ustar00rootroot00000000000000"""Script that switches build backend to setuptools with mypyc support. Overwrites pyproject.toml. Does not create a backup. """ from pathlib import Path import tomllib import tomli_w # type: ignore[import-not-found] def use_setuptools() -> None: pyproject_path = Path(__file__).parent.parent / "pyproject.toml" data = tomllib.loads(pyproject_path.read_bytes().decode()) data["build-system"] = { "requires": ["setuptools>=77.0.3", "mypy[mypyc]>=1.15"], "build-backend": "setuptools.build_meta", } pyproject_path.write_bytes(tomli_w.dumps(data).encode()) if __name__ == "__main__": use_setuptools() hukkin-tomli-7940ff4/setup.py000066400000000000000000000004771513070226000162100ustar00rootroot00000000000000import os from setuptools import setup # type: ignore[import-untyped] if os.environ.get("TOMLI_USE_MYPYC") == "1": import glob from mypyc.build import mypycify files = glob.glob("src/**/*.py", recursive=True) ext_modules = mypycify(files) else: ext_modules = [] setup(ext_modules=ext_modules) hukkin-tomli-7940ff4/src/000077500000000000000000000000001513070226000152555ustar00rootroot00000000000000hukkin-tomli-7940ff4/src/tomli/000077500000000000000000000000001513070226000164015ustar00rootroot00000000000000hukkin-tomli-7940ff4/src/tomli/__init__.py000066400000000000000000000004721513070226000205150ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. __all__ = ("loads", "load", "TOMLDecodeError") __version__ = "2.4.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT from ._parser import TOMLDecodeError, load, loads hukkin-tomli-7940ff4/src/tomli/_parser.py000066400000000000000000000625461513070226000204230ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations import sys from types import MappingProxyType from ._re import ( RE_DATETIME, RE_LOCALTIME, RE_NUMBER, match_to_datetime, match_to_localtime, match_to_number, ) TYPE_CHECKING = False if TYPE_CHECKING: from collections.abc import Iterable from typing import IO, Any, Final from ._types import Key, ParseFloat, Pos # Inline tables/arrays are implemented using recursion. Pathologically # nested documents cause pure Python to raise RecursionError (which is OK), # but mypyc binary wheels will crash unrecoverably (not OK). According to # mypyc docs this will be fixed in the future: # https://mypyc.readthedocs.io/en/latest/differences_from_python.html#stack-overflows # Before mypyc's fix is in, recursion needs to be limited by this library. # Choosing `sys.getrecursionlimit()` as maximum inline table/array nesting # level, as it allows more nesting than pure Python, but still seems a far # lower number than where mypyc binaries crash. MAX_INLINE_NESTING: Final = sys.getrecursionlimit() ASCII_CTRL: Final = frozenset(chr(i) for i in range(32)) | frozenset(chr(127)) # Neither of these sets include quotation mark or backslash. They are # currently handled as separate cases in the parser functions. ILLEGAL_BASIC_STR_CHARS: Final = ASCII_CTRL - frozenset("\t") ILLEGAL_MULTILINE_BASIC_STR_CHARS: Final = ASCII_CTRL - frozenset("\t\n") ILLEGAL_LITERAL_STR_CHARS: Final = ILLEGAL_BASIC_STR_CHARS ILLEGAL_MULTILINE_LITERAL_STR_CHARS: Final = ILLEGAL_MULTILINE_BASIC_STR_CHARS ILLEGAL_COMMENT_CHARS: Final = ILLEGAL_BASIC_STR_CHARS TOML_WS: Final = frozenset(" \t") TOML_WS_AND_NEWLINE: Final = TOML_WS | frozenset("\n") BARE_KEY_CHARS: Final = frozenset( "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789" "-_" ) KEY_INITIAL_CHARS: Final = BARE_KEY_CHARS | frozenset("\"'") HEXDIGIT_CHARS: Final = frozenset("abcdef" "ABCDEF" "0123456789") BASIC_STR_ESCAPE_REPLACEMENTS: Final = MappingProxyType( { "\\b": "\u0008", # backspace "\\t": "\u0009", # tab "\\n": "\u000a", # linefeed "\\f": "\u000c", # form feed "\\r": "\u000d", # carriage return "\\e": "\u001b", # escape '\\"': "\u0022", # quote "\\\\": "\u005c", # backslash } ) class DEPRECATED_DEFAULT: """Sentinel to be used as default arg during deprecation period of TOMLDecodeError's free-form arguments.""" class TOMLDecodeError(ValueError): """An error raised if a document is not valid TOML. Adds the following attributes to ValueError: msg: The unformatted error message doc: The TOML document being parsed pos: The index of doc where parsing failed lineno: The line corresponding to pos colno: The column corresponding to pos """ def __init__( self, msg: str | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, doc: str | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, pos: Pos | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, *args: Any, ): if ( args or not isinstance(msg, str) or not isinstance(doc, str) or not isinstance(pos, int) ): import warnings warnings.warn( "Free-form arguments for TOMLDecodeError are deprecated. " "Please set 'msg' (str), 'doc' (str) and 'pos' (int) arguments only.", DeprecationWarning, stacklevel=2, ) if pos is not DEPRECATED_DEFAULT: args = pos, *args if doc is not DEPRECATED_DEFAULT: args = doc, *args if msg is not DEPRECATED_DEFAULT: args = msg, *args ValueError.__init__(self, *args) return lineno = doc.count("\n", 0, pos) + 1 if lineno == 1: colno = pos + 1 else: colno = pos - doc.rindex("\n", 0, pos) if pos >= len(doc): coord_repr = "end of document" else: coord_repr = f"line {lineno}, column {colno}" errmsg = f"{msg} (at {coord_repr})" ValueError.__init__(self, errmsg) self.msg = msg self.doc = doc self.pos = pos self.lineno = lineno self.colno = colno def load(__fp: IO[bytes], *, parse_float: ParseFloat = float) -> dict[str, Any]: """Parse TOML from a binary file object.""" b = __fp.read() try: s = b.decode() except AttributeError: raise TypeError( "File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`" ) from None return loads(s, parse_float=parse_float) def loads(__s: str, *, parse_float: ParseFloat = float) -> dict[str, Any]: """Parse TOML from a string.""" # The spec allows converting "\r\n" to "\n", even in string # literals. Let's do so to simplify parsing. try: src = __s.replace("\r\n", "\n") except (AttributeError, TypeError): raise TypeError( f"Expected str object, not '{type(__s).__qualname__}'" ) from None pos = 0 out = Output() header: Key = () parse_float = make_safe_parse_float(parse_float) # Parse one statement at a time # (typically means one line in TOML source) while True: # 1. Skip line leading whitespace pos = skip_chars(src, pos, TOML_WS) # 2. Parse rules. Expect one of the following: # - end of file # - end of line # - comment # - key/value pair # - append dict to list (and move to its namespace) # - create dict (and move to its namespace) # Skip trailing whitespace when applicable. try: char = src[pos] except IndexError: break if char == "\n": pos += 1 continue if char in KEY_INITIAL_CHARS: pos = key_value_rule(src, pos, out, header, parse_float) pos = skip_chars(src, pos, TOML_WS) elif char == "[": try: second_char: str | None = src[pos + 1] except IndexError: second_char = None out.flags.finalize_pending() if second_char == "[": pos, header = create_list_rule(src, pos, out) else: pos, header = create_dict_rule(src, pos, out) pos = skip_chars(src, pos, TOML_WS) elif char != "#": raise TOMLDecodeError("Invalid statement", src, pos) # 3. Skip comment pos = skip_comment(src, pos) # 4. Expect end of line or end of file try: char = src[pos] except IndexError: break if char != "\n": raise TOMLDecodeError( "Expected newline or end of document after a statement", src, pos ) pos += 1 return out.data.dict class Flags: """Flags that map to parsed keys/namespaces.""" # Marks an immutable namespace (inline array or inline table). FROZEN: Final = 0 # Marks a nest that has been explicitly created and can no longer # be opened using the "[table]" syntax. EXPLICIT_NEST: Final = 1 def __init__(self) -> None: self._flags: dict[str, dict[Any, Any]] = {} self._pending_flags: set[tuple[Key, int]] = set() def add_pending(self, key: Key, flag: int) -> None: self._pending_flags.add((key, flag)) def finalize_pending(self) -> None: for key, flag in self._pending_flags: self.set(key, flag, recursive=False) self._pending_flags.clear() def unset_all(self, key: Key) -> None: cont = self._flags for k in key[:-1]: if k not in cont: return cont = cont[k]["nested"] cont.pop(key[-1], None) def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003 cont = self._flags key_parent, key_stem = key[:-1], key[-1] for k in key_parent: if k not in cont: cont[k] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont = cont[k]["nested"] if key_stem not in cont: cont[key_stem] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag) def is_(self, key: Key, flag: int) -> bool: if not key: return False # document root has no flags cont = self._flags for k in key[:-1]: if k not in cont: return False inner_cont = cont[k] if flag in inner_cont["recursive_flags"]: return True cont = inner_cont["nested"] key_stem = key[-1] if key_stem in cont: inner_cont = cont[key_stem] return flag in inner_cont["flags"] or flag in inner_cont["recursive_flags"] return False class NestedDict: def __init__(self) -> None: # The parsed content of the TOML document self.dict: dict[str, Any] = {} def get_or_create_nest( self, key: Key, *, access_lists: bool = True, ) -> dict[str, Any]: cont: Any = self.dict for k in key: if k not in cont: cont[k] = {} cont = cont[k] if access_lists and isinstance(cont, list): cont = cont[-1] if not isinstance(cont, dict): raise KeyError("There is no nest behind this key") return cont # type: ignore[no-any-return] def append_nest_to_list(self, key: Key) -> None: cont = self.get_or_create_nest(key[:-1]) last_key = key[-1] if last_key in cont: list_ = cont[last_key] if not isinstance(list_, list): raise KeyError("An object other than list found behind this key") list_.append({}) else: cont[last_key] = [{}] class Output: def __init__(self) -> None: self.data = NestedDict() self.flags = Flags() def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos: try: while src[pos] in chars: pos += 1 except IndexError: pass return pos def skip_until( src: str, pos: Pos, expect: str, *, error_on: frozenset[str], error_on_eof: bool, ) -> Pos: try: new_pos = src.index(expect, pos) except ValueError: new_pos = len(src) if error_on_eof: raise TOMLDecodeError(f"Expected {expect!r}", src, new_pos) from None if not error_on.isdisjoint(src[pos:new_pos]): while src[pos] not in error_on: pos += 1 raise TOMLDecodeError(f"Found invalid character {src[pos]!r}", src, pos) return new_pos def skip_comment(src: str, pos: Pos) -> Pos: try: char: str | None = src[pos] except IndexError: char = None if char == "#": return skip_until( src, pos + 1, "\n", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False ) return pos def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos: while True: pos_before_skip = pos pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) pos = skip_comment(src, pos) if pos == pos_before_skip: return pos def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 1 # Skip "[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN): raise TOMLDecodeError(f"Cannot declare {key} twice", src, pos) out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.get_or_create_nest(key) except KeyError: raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None if not src.startswith("]", pos): raise TOMLDecodeError( "Expected ']' at the end of a table declaration", src, pos ) return pos + 1, key def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 2 # Skip "[[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.FROZEN): raise TOMLDecodeError(f"Cannot mutate immutable namespace {key}", src, pos) # Free the namespace now that it points to another empty list item... out.flags.unset_all(key) # ...but this key precisely is still prohibited from table declaration out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.append_nest_to_list(key) except KeyError: raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None if not src.startswith("]]", pos): raise TOMLDecodeError( "Expected ']]' at the end of an array declaration", src, pos ) return pos + 2, key def key_value_rule( src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat ) -> Pos: pos, key, value = parse_key_value_pair(src, pos, parse_float, nest_lvl=0) key_parent, key_stem = key[:-1], key[-1] abs_key_parent = header + key_parent relative_path_cont_keys = (header + key[:i] for i in range(1, len(key))) for cont_key in relative_path_cont_keys: # Check that dotted key syntax does not redefine an existing table if out.flags.is_(cont_key, Flags.EXPLICIT_NEST): raise TOMLDecodeError(f"Cannot redefine namespace {cont_key}", src, pos) # Containers in the relative path can't be opened with the table syntax or # dotted key/value syntax in following table sections. out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST) if out.flags.is_(abs_key_parent, Flags.FROZEN): raise TOMLDecodeError( f"Cannot mutate immutable namespace {abs_key_parent}", src, pos ) try: nest = out.data.get_or_create_nest(abs_key_parent) except KeyError: raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None if key_stem in nest: raise TOMLDecodeError("Cannot overwrite a value", src, pos) # Mark inline table and array namespaces recursively immutable if isinstance(value, (dict, list)): out.flags.set(header + key, Flags.FROZEN, recursive=True) nest[key_stem] = value return pos def parse_key_value_pair( src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int ) -> tuple[Pos, Key, Any]: pos, key = parse_key(src, pos) try: char: str | None = src[pos] except IndexError: char = None if char != "=": raise TOMLDecodeError("Expected '=' after a key in a key/value pair", src, pos) pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, value = parse_value(src, pos, parse_float, nest_lvl) return pos, key, value def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]: pos, key_part = parse_key_part(src, pos) key: Key = (key_part,) pos = skip_chars(src, pos, TOML_WS) while True: try: char: str | None = src[pos] except IndexError: char = None if char != ".": return pos, key pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, key_part = parse_key_part(src, pos) key += (key_part,) pos = skip_chars(src, pos, TOML_WS) def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]: try: char: str | None = src[pos] except IndexError: char = None if char in BARE_KEY_CHARS: start_pos = pos pos = skip_chars(src, pos, BARE_KEY_CHARS) return pos, src[start_pos:pos] if char == "'": return parse_literal_str(src, pos) if char == '"': return parse_one_line_basic_str(src, pos) raise TOMLDecodeError("Invalid initial character for a key part", src, pos) def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 return parse_basic_str(src, pos, multiline=False) def parse_array( src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int ) -> tuple[Pos, list[Any]]: pos += 1 array: list[Any] = [] pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array while True: pos, val = parse_value(src, pos, parse_float, nest_lvl) array.append(val) pos = skip_comments_and_array_ws(src, pos) c = src[pos : pos + 1] if c == "]": return pos + 1, array if c != ",": raise TOMLDecodeError("Unclosed array", src, pos) pos += 1 pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array def parse_inline_table( src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int ) -> tuple[Pos, dict[str, Any]]: pos += 1 nested_dict = NestedDict() flags = Flags() pos = skip_comments_and_array_ws(src, pos) if src.startswith("}", pos): return pos + 1, nested_dict.dict while True: pos, key, value = parse_key_value_pair(src, pos, parse_float, nest_lvl) key_parent, key_stem = key[:-1], key[-1] if flags.is_(key, Flags.FROZEN): raise TOMLDecodeError(f"Cannot mutate immutable namespace {key}", src, pos) try: nest = nested_dict.get_or_create_nest(key_parent, access_lists=False) except KeyError: raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None if key_stem in nest: raise TOMLDecodeError(f"Duplicate inline table key {key_stem!r}", src, pos) nest[key_stem] = value pos = skip_comments_and_array_ws(src, pos) c = src[pos : pos + 1] if c == "}": return pos + 1, nested_dict.dict if c != ",": raise TOMLDecodeError("Unclosed inline table", src, pos) pos += 1 pos = skip_comments_and_array_ws(src, pos) if src.startswith("}", pos): return pos + 1, nested_dict.dict if isinstance(value, (dict, list)): flags.set(key, Flags.FROZEN, recursive=True) def parse_basic_str_escape( src: str, pos: Pos, *, multiline: bool = False ) -> tuple[Pos, str]: escape_id = src[pos : pos + 2] pos += 2 if multiline and escape_id in {"\\ ", "\\\t", "\\\n"}: # Skip whitespace until next non-whitespace character or end of # the doc. Error if non-whitespace is found before newline. if escape_id != "\\\n": pos = skip_chars(src, pos, TOML_WS) try: char = src[pos] except IndexError: return pos, "" if char != "\n": raise TOMLDecodeError("Unescaped '\\' in a string", src, pos) pos += 1 pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) return pos, "" if escape_id == "\\x": return parse_hex_char(src, pos, 2) if escape_id == "\\u": return parse_hex_char(src, pos, 4) if escape_id == "\\U": return parse_hex_char(src, pos, 8) try: return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id] except KeyError: raise TOMLDecodeError("Unescaped '\\' in a string", src, pos) from None def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]: return parse_basic_str_escape(src, pos, multiline=True) def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]: hex_str = src[pos : pos + hex_len] if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str): raise TOMLDecodeError("Invalid hex value", src, pos) pos += hex_len hex_int = int(hex_str, 16) if not is_unicode_scalar_value(hex_int): raise TOMLDecodeError( "Escaped character is not a Unicode scalar value", src, pos ) return pos, chr(hex_int) def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 # Skip starting apostrophe start_pos = pos pos = skip_until( src, pos, "'", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True ) return pos + 1, src[start_pos:pos] # Skip ending apostrophe def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]: pos += 3 if src.startswith("\n", pos): pos += 1 if literal: delim = "'" end_pos = skip_until( src, pos, "'''", error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS, error_on_eof=True, ) result = src[pos:end_pos] pos = end_pos + 3 else: delim = '"' pos, result = parse_basic_str(src, pos, multiline=True) # Add at maximum two extra apostrophes/quotes if the end sequence # is 4 or 5 chars long instead of just 3. if not src.startswith(delim, pos): return pos, result pos += 1 if not src.startswith(delim, pos): return pos, result + delim pos += 1 return pos, result + (delim * 2) def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]: if multiline: error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape_multiline else: error_on = ILLEGAL_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape result = "" start_pos = pos while True: try: char = src[pos] except IndexError: raise TOMLDecodeError("Unterminated string", src, pos) from None if char == '"': if not multiline: return pos + 1, result + src[start_pos:pos] if src.startswith('"""', pos): return pos + 3, result + src[start_pos:pos] pos += 1 continue if char == "\\": result += src[start_pos:pos] pos, parsed_escape = parse_escapes(src, pos) result += parsed_escape start_pos = pos continue if char in error_on: raise TOMLDecodeError(f"Illegal character {char!r}", src, pos) pos += 1 def parse_value( src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int ) -> tuple[Pos, Any]: if nest_lvl > MAX_INLINE_NESTING: # Pure Python should have raised RecursionError already. # This ensures mypyc binaries eventually do the same. raise RecursionError( # pragma: no cover "TOML inline arrays/tables are nested more than the allowed" f" {MAX_INLINE_NESTING} levels" ) try: char: str | None = src[pos] except IndexError: char = None # IMPORTANT: order conditions based on speed of checking and likelihood # Basic strings if char == '"': if src.startswith('"""', pos): return parse_multiline_str(src, pos, literal=False) return parse_one_line_basic_str(src, pos) # Literal strings if char == "'": if src.startswith("'''", pos): return parse_multiline_str(src, pos, literal=True) return parse_literal_str(src, pos) # Booleans if char == "t": if src.startswith("true", pos): return pos + 4, True if char == "f": if src.startswith("false", pos): return pos + 5, False # Arrays if char == "[": return parse_array(src, pos, parse_float, nest_lvl + 1) # Inline tables if char == "{": return parse_inline_table(src, pos, parse_float, nest_lvl + 1) # Dates and times datetime_match = RE_DATETIME.match(src, pos) if datetime_match: try: datetime_obj = match_to_datetime(datetime_match) except ValueError as e: raise TOMLDecodeError("Invalid date or datetime", src, pos) from e return datetime_match.end(), datetime_obj localtime_match = RE_LOCALTIME.match(src, pos) if localtime_match: return localtime_match.end(), match_to_localtime(localtime_match) # Integers and "normal" floats. # The regex will greedily match any type starting with a decimal # char, so needs to be located after handling of dates and times. number_match = RE_NUMBER.match(src, pos) if number_match: return number_match.end(), match_to_number(number_match, parse_float) # Special floats first_three = src[pos : pos + 3] if first_three in {"inf", "nan"}: return pos + 3, parse_float(first_three) first_four = src[pos : pos + 4] if first_four in {"-inf", "+inf", "-nan", "+nan"}: return pos + 4, parse_float(first_four) raise TOMLDecodeError("Invalid value", src, pos) def is_unicode_scalar_value(codepoint: int) -> bool: return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111) def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat: """A decorator to make `parse_float` safe. `parse_float` must not return dicts or lists, because these types would be mixed with parsed TOML tables and arrays, thus confusing the parser. The returned decorated callable raises `ValueError` instead of returning illegal types. """ # The default `float` callable never returns illegal types. Optimize it. if parse_float is float: return float def safe_parse_float(float_str: str) -> Any: float_value = parse_float(float_str) if isinstance(float_value, (dict, list)): raise ValueError("parse_float must not return dicts or lists") return float_value return safe_parse_float hukkin-tomli-7940ff4/src/tomli/_re.py000066400000000000000000000065041513070226000175250ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations from datetime import date, datetime, time, timedelta, timezone, tzinfo from functools import lru_cache import re TYPE_CHECKING = False if TYPE_CHECKING: from typing import Any, Final from ._types import ParseFloat _TIME_RE_STR: Final = r""" ([01][0-9]|2[0-3]) # hours :([0-5][0-9]) # minutes (?: :([0-5][0-9]) # optional seconds (?:\.([0-9]{1,6})[0-9]*)? # optional fractions of a second )? """ RE_NUMBER: Final = re.compile( r""" 0 (?: x[0-9A-Fa-f](?:_?[0-9A-Fa-f])* # hex | b[01](?:_?[01])* # bin | o[0-7](?:_?[0-7])* # oct ) | [+-]?(?:0|[1-9](?:_?[0-9])*) # dec, integer part (?P (?:\.[0-9](?:_?[0-9])*)? # optional fractional part (?:[eE][+-]?[0-9](?:_?[0-9])*)? # optional exponent part ) """, flags=re.VERBOSE, ) RE_LOCALTIME: Final = re.compile(_TIME_RE_STR, flags=re.VERBOSE) RE_DATETIME: Final = re.compile( rf""" ([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27 (?: [Tt ] {_TIME_RE_STR} (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset )? """, flags=re.VERBOSE, ) def match_to_datetime(match: re.Match[str]) -> datetime | date: """Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. Raises ValueError if the match does not correspond to a valid date or datetime. """ ( year_str, month_str, day_str, hour_str, minute_str, sec_str, micros_str, zulu_time, offset_sign_str, offset_hour_str, offset_minute_str, ) = match.groups() year, month, day = int(year_str), int(month_str), int(day_str) if hour_str is None: return date(year, month, day) hour, minute = int(hour_str), int(minute_str) sec = int(sec_str) if sec_str else 0 micros = int(micros_str.ljust(6, "0")) if micros_str else 0 if offset_sign_str: tz: tzinfo | None = cached_tz( offset_hour_str, offset_minute_str, offset_sign_str ) elif zulu_time: tz = timezone.utc else: # local date-time tz = None return datetime(year, month, day, hour, minute, sec, micros, tzinfo=tz) # No need to limit cache size. This is only ever called on input # that matched RE_DATETIME, so there is an implicit bound of # 24 (hours) * 60 (minutes) * 2 (offset direction) = 2880. @lru_cache(maxsize=None) def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone: sign = 1 if sign_str == "+" else -1 return timezone( timedelta( hours=sign * int(hour_str), minutes=sign * int(minute_str), ) ) def match_to_localtime(match: re.Match[str]) -> time: hour_str, minute_str, sec_str, micros_str = match.groups() sec = int(sec_str) if sec_str else 0 micros = int(micros_str.ljust(6, "0")) if micros_str else 0 return time(int(hour_str), int(minute_str), sec, micros) def match_to_number(match: re.Match[str], parse_float: ParseFloat) -> Any: if match.group("floatpart"): return parse_float(match.group()) return int(match.group(), 0) hukkin-tomli-7940ff4/src/tomli/_types.py000066400000000000000000000003761513070226000202640ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from typing import Any, Callable, Tuple # Type annotations ParseFloat = Callable[[str], Any] Key = Tuple[str, ...] Pos = int hukkin-tomli-7940ff4/src/tomli/py.typed000066400000000000000000000000321513070226000200730ustar00rootroot00000000000000# Marker file for PEP 561 hukkin-tomli-7940ff4/tests/000077500000000000000000000000001513070226000156305ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/__init__.py000066400000000000000000000004051513070226000177400ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. __all__ = ("tomllib",) # By changing this one line, we can run the tests against # a different module name. import tomli as tomllib hukkin-tomli-7940ff4/tests/burntsushi.py000066400000000000000000000061441513070226000204150ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. """Utilities for tests that are in the "burntsushi" format.""" import datetime from typing import Any def convert(obj): if isinstance(obj, str): return {"type": "string", "value": obj} elif isinstance(obj, bool): return {"type": "bool", "value": str(obj).lower()} elif isinstance(obj, int): return {"type": "integer", "value": str(obj)} elif isinstance(obj, float): return {"type": "float", "value": _normalize_float_str(str(obj))} elif isinstance(obj, datetime.datetime): val = _normalize_datetime_str(obj.isoformat()) if obj.tzinfo: return {"type": "datetime", "value": val} return {"type": "datetime-local", "value": val} elif isinstance(obj, datetime.time): return { "type": "time-local", "value": _normalize_localtime_str(str(obj)), } elif isinstance(obj, datetime.date): return { "type": "date-local", "value": str(obj), } elif isinstance(obj, list): return [convert(i) for i in obj] # type: ignore[no-untyped-call] elif isinstance(obj, dict): return {k: convert(v) for k, v in obj.items()} # type: ignore[no-untyped-call] raise Exception("unsupported type") def normalize(obj: Any) -> Any: """Normalize test objects. This normalizes primitive values (e.g. floats).""" if isinstance(obj, list): return [normalize(item) for item in obj] if isinstance(obj, dict): if "type" in obj and "value" in obj: type_ = obj["type"] value = obj["value"] if type_ == "float": norm_value = _normalize_float_str(value) elif type_ in {"datetime", "datetime-local"}: norm_value = _normalize_datetime_str(value) elif type_ == "time-local": norm_value = _normalize_localtime_str(value) else: norm_value = value if type_ == "array": return [normalize(item) for item in value] return {"type": type_, "value": norm_value} return {k: normalize(v) for k, v in obj.items()} raise AssertionError("Burntsushi fixtures should be dicts/lists only") def _normalize_datetime_str(dt_str: str) -> str: if dt_str[-1].lower() == "z": dt_str = dt_str[:-1] + "+00:00" date = dt_str[:10] rest = dt_str[11:] if "+" in rest: sign = "+" elif "-" in rest: sign = "-" else: sign = "" if sign: time, _, offset = rest.partition(sign) else: time = rest offset = "" time = time.rstrip("0") if "." in time else time return date + "T" + time + sign + offset def _normalize_localtime_str(lt_str: str) -> str: return lt_str.rstrip("0") if "." in lt_str else lt_str def _normalize_float_str(float_str: str) -> str: as_float = float(float_str) # Normalize "-0.0" and "+0.0" if as_float == 0: return "0" return str(as_float) hukkin-tomli-7940ff4/tests/data/000077500000000000000000000000001513070226000165415ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/000077500000000000000000000000001513070226000201675ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/000077500000000000000000000000001513070226000221505ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/000077500000000000000000000000001513070226000241005ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/LICENSE000066400000000000000000000020671513070226000251120ustar00rootroot00000000000000The 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. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/000077500000000000000000000000001513070226000255265ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/000077500000000000000000000000001513070226000266445ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/double-comma-01.toml000066400000000000000000000000311513070226000323150ustar00rootroot00000000000000double-comma-01 = [1,,2] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/double-comma-02.toml000066400000000000000000000000321513070226000323170ustar00rootroot00000000000000double-comma-02 = [1,2,,] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/extend-defined-aot.toml000066400000000000000000000000351513070226000332030ustar00rootroot00000000000000[[tab.arr]] [tab] arr.val1=1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/extending-table.toml000066400000000000000000000001721513070226000326130ustar00rootroot00000000000000a = [{ b = 1 }] # Cannot extend tables within static arrays # https://github.com/toml-lang/toml/issues/908 [a.c] foo = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/missing-separator-01.toml000066400000000000000000000000241513070226000334220ustar00rootroot00000000000000arrr = [true false] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/missing-separator-02.toml000066400000000000000000000000221513070226000334210ustar00rootroot00000000000000wrong = [ 1 2 3 ] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-01.toml000066400000000000000000000000301513070226000314670ustar00rootroot00000000000000no-close-01 = [ 1, 2, 3 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-02.toml000066400000000000000000000000221513070226000314710ustar00rootroot00000000000000no-close-02 = [1, hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-03.toml000066400000000000000000000000251513070226000314750ustar00rootroot00000000000000no-close-03 = [42 #] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-04.toml000066400000000000000000000000321513070226000314740ustar00rootroot00000000000000no-close-04 = [{ key = 42 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-05.toml000066400000000000000000000000331513070226000314760ustar00rootroot00000000000000no-close-05 = [{ key = 42} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-06.toml000066400000000000000000000000361513070226000315020ustar00rootroot00000000000000no-close-06 = [{ key = 42 #}] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-07.toml000066400000000000000000000000361513070226000315030ustar00rootroot00000000000000no-close-07 = [{ key = 42} #] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-08.toml000066400000000000000000000000201513070226000314750ustar00rootroot00000000000000no-close-08 = [ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-table-01.toml000066400000000000000000000000201513070226000325530ustar00rootroot00000000000000x = [{ key = 42 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-close-table-02.toml000066400000000000000000000000221513070226000325560ustar00rootroot00000000000000x = [{ key = 42 # hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-comma-01.toml000066400000000000000000000000331513070226000314610ustar00rootroot00000000000000no-comma-01 = [true false] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-comma-02.toml000066400000000000000000000000301513070226000314570ustar00rootroot00000000000000no-comma-02 = [ 1 2 3 ] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/no-comma-03.toml000066400000000000000000000000261513070226000314650ustar00rootroot00000000000000no-comma-03 = [ 1 #,] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/only-comma-01.toml000066400000000000000000000000241513070226000320260ustar00rootroot00000000000000only-comma-01 = [,] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/only-comma-02.toml000066400000000000000000000000251513070226000320300ustar00rootroot00000000000000only-comma-02 = [,,] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/tables-01.toml000066400000000000000000000000671513070226000312340ustar00rootroot00000000000000# INVALID TOML DOC fruit = [] [[fruit]] # Not allowed hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/tables-02.toml000066400000000000000000000002741513070226000312350ustar00rootroot00000000000000# INVALID TOML DOC [[fruit]] name = "apple" [[fruit.variety]] name = "red delicious" # This table conflicts with the previous table [fruit.variety] name = "granny smith" text-after-array-entries.toml000066400000000000000000000001061513070226000343250ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/arrayarray = [ "Is there life after an array separator?", No "Entry" ] text-before-array-separator.toml000066400000000000000000000001071513070226000350160ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/arrayarray = [ "Is there life before an array separator?" No, "Entry" ] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/array/text-in-array.toml000066400000000000000000000000701513070226000322420ustar00rootroot00000000000000array = [ "Entry 1", I don't belong, "Entry 2", ] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/000077500000000000000000000000001513070226000264615ustar00rootroot00000000000000almost-false-with-extra.toml000066400000000000000000000000421513070226000337540ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/boolalmost-false-with-extra = falsify hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/almost-false.toml000066400000000000000000000000371513070226000317450ustar00rootroot00000000000000almost-false = fals hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/almost-true-with-extra.toml000066400000000000000000000000411513070226000337170ustar00rootroot00000000000000almost-true-with-extra = truthy hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/almost-true.toml000066400000000000000000000000361513070226000316310ustar00rootroot00000000000000almost-true = tru hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/capitalized-false.toml000066400000000000000000000000411513070226000327320ustar00rootroot00000000000000capitalized-false = False hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/capitalized-true.toml000066400000000000000000000000401513070226000326160ustar00rootroot00000000000000capitalized-true = True hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/just-f.toml000066400000000000000000000000341513070226000305630ustar00rootroot00000000000000just-f = f hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/just-t.toml000066400000000000000000000000341513070226000306010ustar00rootroot00000000000000just-t = t hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/mixed-case-false.toml000066400000000000000000000000401513070226000324570ustar00rootroot00000000000000mixed-case-false = falsE hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/mixed-case-true.toml000066400000000000000000000000371513070226000323520ustar00rootroot00000000000000mixed-case-true = trUe hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/mixed-case.toml000066400000000000000000000000521513070226000313720ustar00rootroot00000000000000mixed-case = valid = False hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/starting-same-false.toml000066400000000000000000000000411513070226000332170ustar00rootroot00000000000000starting-same-false = falsey hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/starting-same-true.toml000066400000000000000000000000401513070226000331030ustar00rootroot00000000000000starting-same-true = truer hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/wrong-case-false.toml000066400000000000000000000000401513070226000325050ustar00rootroot00000000000000wrong-case-false = FALSE hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/bool/wrong-case-true.toml000066400000000000000000000000371513070226000324000ustar00rootroot00000000000000wrong-case-true = TRUE hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/000077500000000000000000000000001513070226000272065ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/bare-cr.toml000066400000000000000000000001131513070226000314110ustar00rootroot00000000000000# The following line contains a single carriage return control character hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/bare-formfeed.toml000066400000000000000000000000261513070226000325770ustar00rootroot00000000000000bare-formfeed = hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/bare-null.toml000066400000000000000000000000431513070226000317610ustar00rootroot00000000000000bare-null = "some value" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/bare-vertical-tab.toml000066400000000000000000000000261513070226000333650ustar00rootroot00000000000000bare-vertical-tab = hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-cr.toml000066400000000000000000000000631513070226000321460ustar00rootroot00000000000000comment-cr = "Carriage return in comment" # a=1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-del.toml000066400000000000000000000000341513070226000323040ustar00rootroot00000000000000comment-del = "0x7f" #  hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-ff.toml000066400000000000000000000000341513070226000321330ustar00rootroot00000000000000comment-ff = "0x7f" # hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-lf.toml000066400000000000000000000000341513070226000321410ustar00rootroot00000000000000comment-lf = "ctrl-P" #  hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-null.toml000066400000000000000000000000341513070226000325120ustar00rootroot00000000000000comment-null = "null" # hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/comment-us.toml000066400000000000000000000000341513070226000321670ustar00rootroot00000000000000comment-us = "ctrl-_" #  hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/multi-cr.toml000066400000000000000000000000311513070226000316310ustar00rootroot00000000000000multi-cr = """null """ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/multi-del.toml000066400000000000000000000000311513070226000317710ustar00rootroot00000000000000multi-del = """null""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/multi-lf.toml000066400000000000000000000000311513070226000316260ustar00rootroot00000000000000multi-lf = """null""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/multi-null.toml000066400000000000000000000000311513070226000321770ustar00rootroot00000000000000multi-null = """null""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/multi-us.toml000066400000000000000000000000311513070226000316540ustar00rootroot00000000000000multi-us = """null""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/only-ff.toml000066400000000000000000000000011513070226000314440ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/only-null.toml000066400000000000000000000000011513070226000320230ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/only-vt.toml000066400000000000000000000000011513070226000315020ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawmulti-cr.toml000066400000000000000000000000341513070226000323460ustar00rootroot00000000000000rawmulti-cr = '''null ''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawmulti-del.toml000066400000000000000000000000341513070226000325060ustar00rootroot00000000000000rawmulti-del = '''null''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawmulti-lf.toml000066400000000000000000000000341513070226000323430ustar00rootroot00000000000000rawmulti-lf = '''null''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawmulti-null.toml000066400000000000000000000000341513070226000327140ustar00rootroot00000000000000rawmulti-null = '''null''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawmulti-us.toml000066400000000000000000000000341513070226000323710ustar00rootroot00000000000000rawmulti-us = '''null''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawstring-cr.toml000066400000000000000000000000311513070226000325170ustar00rootroot00000000000000rawstring-cr = 'null ' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawstring-del.toml000066400000000000000000000000311513070226000326570ustar00rootroot00000000000000rawstring-del = 'null' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawstring-lf.toml000066400000000000000000000000311513070226000325140ustar00rootroot00000000000000rawstring-lf = 'null' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawstring-null.toml000066400000000000000000000000311513070226000330650ustar00rootroot00000000000000rawstring-null = 'null' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/rawstring-us.toml000066400000000000000000000000311513070226000325420ustar00rootroot00000000000000rawstring-us = 'null' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-bs.toml000066400000000000000000000000331513070226000320070ustar00rootroot00000000000000string-bs = "backspace" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-cr.toml000066400000000000000000000000261513070226000320110ustar00rootroot00000000000000string-cr = "null " hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-del.toml000066400000000000000000000000261513070226000321510ustar00rootroot00000000000000string-del = "null" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-lf.toml000066400000000000000000000000261513070226000320060ustar00rootroot00000000000000string-lf = "null" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-null.toml000066400000000000000000000000261513070226000323570ustar00rootroot00000000000000string-null = "null" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/control/string-us.toml000066400000000000000000000000261513070226000320340ustar00rootroot00000000000000string-us = "null" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/000077500000000000000000000000001513070226000273225ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/day-zero.toml000066400000000000000000000000361513070226000317500ustar00rootroot00000000000000foo = 1997-09-00T09:09:09.09Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/feb-29.toml000066400000000000000000000000511513070226000311770ustar00rootroot00000000000000"not a leap year" = 2100-02-29T15:15:15Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/feb-30.toml000066400000000000000000000000701513070226000311700ustar00rootroot00000000000000"only 28 or 29 days in february" = 1988-02-30T15:15:15Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/hour-over.toml000066400000000000000000000001021513070226000321360ustar00rootroot00000000000000# time-hour = 2DIGIT ; 00-23 d = 2006-01-01T24:00:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/mday-over.toml000066400000000000000000000002111513070226000321140ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-32T00:00:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/mday-under.toml000066400000000000000000000002111513070226000322560ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-00T00:00:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/minute-over.toml000066400000000000000000000001021513070226000324620ustar00rootroot00000000000000# time-minute = 2DIGIT ; 00-59 d = 2006-01-01T00:60:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/month-over.toml000066400000000000000000000001021513070226000323060ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2006-13-01T00:00:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/month-under.toml000066400000000000000000000001021513070226000324500ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2007-00-01T00:00:00-00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/no-date-time-sep.toml000066400000000000000000000000311513070226000332610ustar00rootroot00000000000000foo = 1997-09-0909:09:09 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/no-leads-month.toml000066400000000000000000000001321513070226000330400ustar00rootroot00000000000000# Month "7" instead of "07"; the leading zero is required. no-leads = 1987-7-05T17:45:00Z no-leads-with-milli.toml000066400000000000000000000001351513070226000337160ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime# Day "5" instead of "05"; the leading zero is required. with-milli = 1987-07-5T17:45:00.12Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/no-leads.toml000066400000000000000000000001321513070226000317150ustar00rootroot00000000000000# Month "7" instead of "07"; the leading zero is required. no-leads = 1987-7-05T17:45:00Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/no-t.toml000066400000000000000000000001061513070226000310710ustar00rootroot00000000000000# No "t" or "T" between the date and time. no-t = 1987-07-0517:45:00Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/no-year-month-sep.toml000066400000000000000000000000201513070226000334710ustar00rootroot00000000000000foo = 199709-09 offset-minus-minute-1digit.toml000066400000000000000000000000421513070226000352310ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+09:9 offset-minus-no-hour-minute-sep.toml000066400000000000000000000000421513070226000362240ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+0909 offset-minus-no-hour-minute.toml000066400000000000000000000000361513070226000354420ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+ offset-minus-no-minute.toml000066400000000000000000000000401513070226000344620ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+09 offset-overflow-hour.toml000066400000000000000000000000631513070226000342410ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime# Hour must be 00-24 d = 1985-06-18 17:04:07+25:00 offset-overflow-minute.toml000066400000000000000000000000361513070226000345650ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimed = 1985-06-18 17:04:07+12:60 offset-plus-minute-1digit.toml000066400000000000000000000000421513070226000350610ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+09:9 offset-plus-no-hour-minute-sep.toml000066400000000000000000000000421513070226000360540ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+0909 offset-plus-no-hour-minute.toml000066400000000000000000000000361513070226000352720ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+ offset-plus-no-minute.toml000066400000000000000000000000401513070226000343120ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09.09+09 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/only-T.toml000066400000000000000000000000101513070226000313700ustar00rootroot00000000000000foo = T hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/only-TZ.toml000066400000000000000000000000111513070226000315230ustar00rootroot00000000000000foo = TZ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/only-Tdot.toml000066400000000000000000000000111513070226000321000ustar00rootroot00000000000000foo = T. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/second-over.toml000066400000000000000000000002111513070226000324350ustar00rootroot00000000000000# time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second # ; rules d = 2006-01-01T00:00:61-00:00 second-trailing-dot.toml000066400000000000000000000000331513070226000340020ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 1997-09-09T09:09:09. second-trailing-dotz.toml000066400000000000000000000000341513070226000341750ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetimefoo = 2016-09-09T09:09:09.Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/time-no-leads.toml000066400000000000000000000000701513070226000326520ustar00rootroot00000000000000# Leading 0 is always required. d = 2023-10-01T1:32:00Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/trailing-x.toml000066400000000000000000000000211513070226000322660ustar00rootroot00000000000000sign=2020-01-01x hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/datetime/y10k.toml000066400000000000000000000000721513070226000310020ustar00rootroot00000000000000# Maximum RFC3399 year is 9999. d = 10000-01-01 00:00:00z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/000077500000000000000000000000001513070226000273145ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/bad-codepoint.toml000066400000000000000000000000411513070226000327140ustar00rootroot00000000000000# Invalid codepoint U+D800 : hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/bad-utf8-at-end.toml000066400000000000000000000003621513070226000327720ustar00rootroot00000000000000# There is a 0xda at after the quotes, and no EOL at the end of the file. # # This is a bit of an edge case: This indicates there should be two bytes # (0b1101_1010) but there is no byte to follow because it's the end of the file. x = """"""hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/bad-utf8-in-array.toml000066400000000000000000000001251513070226000333410ustar00rootroot00000000000000# https://github.com/marzer/tomlplusplus/issues/100 fl =[ [[[[[[[[[[[[[[[6-6Ÿ bad-utf8-in-comment.toml000066400000000000000000000000041513070226000336020ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding# bad-utf8-in-multiline-literal.toml000066400000000000000000000001071513070226000356000ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding# The following line contains an invalid UTF-8 sequence. bad = '''''' bad-utf8-in-multiline.toml000066400000000000000000000001071513070226000341460ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding# The following line contains an invalid UTF-8 sequence. bad = """""" bad-utf8-in-string-literal.toml000066400000000000000000000001031513070226000351000ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding# The following line contains an invalid UTF-8 sequence. bad = '' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/bad-utf8-in-string.toml000066400000000000000000000001031513070226000335250ustar00rootroot00000000000000# The following line contains an invalid UTF-8 sequence. bad = "" bom-not-at-start-01.toml000066400000000000000000000000241513070226000334540ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encodingbom-not-at-start bom-not-at-start-02.toml000066400000000000000000000000251513070226000334560ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encodingbom-not-at-start= hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/ideographic-space.toml000066400000000000000000000001001513070226000335470ustar00rootroot00000000000000# First on next line is U+3000 IDEOGRAPHIC SPACE  foo = "bar" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/utf16-bom.toml000066400000000000000000000000461513070226000317310ustar00rootroot00000000000000# UTF-16 with BOM hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/utf16-comment.toml000066400000000000000000000000521513070226000326130ustar00rootroot00000000000000# UTF-16 without BOM hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/encoding/utf16-key.toml000066400000000000000000000000201513070226000317340ustar00rootroot00000000000000k = "v" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/000077500000000000000000000000001513070226000266335ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/double-dot-01.toml000066400000000000000000000000251513070226000320010ustar00rootroot00000000000000double-dot-01 = 0..1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/double-dot-02.toml000066400000000000000000000000261513070226000320030ustar00rootroot00000000000000double-dot-02 = 0.1.2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-dot-01.toml000066400000000000000000000000231513070226000313210ustar00rootroot00000000000000exp-dot-01 = 1e2.3 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-dot-02.toml000066400000000000000000000000221513070226000313210ustar00rootroot00000000000000exp-dot-02 = 1.e2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-dot-03.toml000066400000000000000000000000241513070226000313240ustar00rootroot00000000000000exp-dot-03 = 3.e+20 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-double-e-01.toml000066400000000000000000000000271513070226000322330ustar00rootroot00000000000000exp-double-e-01 = 1ee2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-double-e-02.toml000066400000000000000000000000301513070226000322260ustar00rootroot00000000000000exp-double-e-02 = 1e2e3 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-double-us.toml000066400000000000000000000000271513070226000322200ustar00rootroot00000000000000exp-double-us = 1e__23 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-leading-us.toml000066400000000000000000000000271513070226000323510ustar00rootroot00000000000000exp-leading-us = 1e_23 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-trailing-us-01.toml000066400000000000000000000000321513070226000327710ustar00rootroot00000000000000exp-trailing-us-01 = 1_e2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-trailing-us-02.toml000066400000000000000000000000341513070226000327740ustar00rootroot00000000000000exp-trailing-us-02 = 1.2_e2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/exp-trailing-us.toml000066400000000000000000000000301513070226000325510ustar00rootroot00000000000000exp-trailing-us = 1e23_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/inf-capital.toml000066400000000000000000000000101513070226000317060ustar00rootroot00000000000000v = Inf hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/inf-incomplete-01.toml000066400000000000000000000000271513070226000326560ustar00rootroot00000000000000inf-incomplete-01 = in hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/inf-incomplete-02.toml000066400000000000000000000000301513070226000326510ustar00rootroot00000000000000inf-incomplete-02 = +in hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/inf-incomplete-03.toml000066400000000000000000000000301513070226000326520ustar00rootroot00000000000000inf-incomplete-03 = -in hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/inf_underscore.toml000066400000000000000000000000261513070226000325330ustar00rootroot00000000000000inf_underscore = in_f hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-dot-neg.toml000066400000000000000000000000321513070226000324610ustar00rootroot00000000000000leading-dot-neg = -.12345 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-dot-plus.toml000066400000000000000000000000331513070226000326740ustar00rootroot00000000000000leading-dot-plus = +.12345 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-dot.toml000066400000000000000000000000251513070226000317140ustar00rootroot00000000000000leading-dot = .12345 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-us.toml000066400000000000000000000000221513070226000315520ustar00rootroot00000000000000leading-us = _1.2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-zero-neg.toml000066400000000000000000000000321513070226000326520ustar00rootroot00000000000000leading-zero-neg = -03.14 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-zero-plus.toml000066400000000000000000000000331513070226000330650ustar00rootroot00000000000000leading-zero-plus = +03.14 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/leading-zero.toml000066400000000000000000000000251513070226000321050ustar00rootroot00000000000000leading-zero = 03.14 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/nan-capital.toml000066400000000000000000000000101513070226000317060ustar00rootroot00000000000000v = NaN hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/nan-incomplete-01.toml000066400000000000000000000000271513070226000326560ustar00rootroot00000000000000nan-incomplete-01 = na hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/nan-incomplete-02.toml000066400000000000000000000000301513070226000326510ustar00rootroot00000000000000nan-incomplete-02 = +na hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/nan-incomplete-03.toml000066400000000000000000000000301513070226000326520ustar00rootroot00000000000000nan-incomplete-03 = -na hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/nan_underscore.toml000066400000000000000000000000261513070226000325330ustar00rootroot00000000000000nan_underscore = na_n hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-dot-01.toml000066400000000000000000000000241513070226000323370ustar00rootroot00000000000000trailing-point = 1. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-dot-02.toml000066400000000000000000000000151513070226000323400ustar00rootroot00000000000000a = 1. b = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-dot-min.toml000066400000000000000000000000271513070226000327050ustar00rootroot00000000000000trailing-dot-min = -1. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-dot-plus.toml000066400000000000000000000000301513070226000330770ustar00rootroot00000000000000trailing-dot-plus = +1. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-dot.toml000066400000000000000000000000221513070226000321170ustar00rootroot00000000000000trailing-dot = 1. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-exp-dot.toml000066400000000000000000000000301513070226000327100ustar00rootroot00000000000000trailing-exp-dot = 0.e hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-exp-minus.toml000066400000000000000000000000331513070226000332600ustar00rootroot00000000000000trailing-exp-minus = 0.0e- hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-exp-plus.toml000066400000000000000000000000321513070226000331070ustar00rootroot00000000000000trailing-exp-plus = 0.0e+ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-exp.toml000066400000000000000000000000241513070226000321270ustar00rootroot00000000000000trailing-exp = 0.0E hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-us-exp-01.toml000066400000000000000000000000311513070226000327700ustar00rootroot00000000000000trailing-us-exp-1 = 1_e2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-us-exp-02.toml000066400000000000000000000000331513070226000327730ustar00rootroot00000000000000trailing-us-exp-2 = 1.2_e2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/trailing-us.toml000066400000000000000000000000231513070226000317610ustar00rootroot00000000000000trailing-us = 1.2_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/us-after-dot.toml000066400000000000000000000000241513070226000320360ustar00rootroot00000000000000us-after-dot = 1._2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/float/us-before-dot.toml000066400000000000000000000000251513070226000322000ustar00rootroot00000000000000us-before-dot = 1_.2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/000077500000000000000000000000001513070226000300715ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/bad-key-syntax.toml000066400000000000000000000000251513070226000336230ustar00rootroot00000000000000tbl = { a = 1, [b] } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/double-comma.toml000066400000000000000000000000171513070226000333300ustar00rootroot00000000000000t = {x=3,,y=4} duplicate-key-01.toml000066400000000000000000000001011513070226000336550ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table# Duplicate keys within an inline table are invalid a={b=1, b=2} duplicate-key-02.toml000066400000000000000000000000561513070226000336670ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-tabletable1 = { table2.dupe = 1, table2.dupe = 2 } duplicate-key-03.toml000066400000000000000000000001241513070226000336640ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-tabletbl = { fruit = { apple.color = "red" }, fruit.apple.texture = { smooth = true } } duplicate-key-04.toml000066400000000000000000000000471513070226000336710ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-tabletbl = { a.b = "a_b", a.b.c = "a_b_c" } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/empty-01.toml000066400000000000000000000000101513070226000323310ustar00rootroot00000000000000t = {,} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/empty-02.toml000066400000000000000000000000111513070226000323330ustar00rootroot00000000000000t = {, } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/empty-03.toml000066400000000000000000000000121513070226000323350ustar00rootroot00000000000000t = { , } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/no-close-01.toml000066400000000000000000000000041513070226000327150ustar00rootroot00000000000000a={ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/no-close-02.toml000066400000000000000000000000071513070226000327210ustar00rootroot00000000000000a={b=1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/no-comma-01.toml000066400000000000000000000000221513070226000327040ustar00rootroot00000000000000t = {x = 3 y = 4} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/no-comma-02.toml000066400000000000000000000000631513070226000327120ustar00rootroot00000000000000arrr = { comma-missing = true valid-toml = false } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-01.toml000066400000000000000000000001321513070226000332260ustar00rootroot00000000000000a.b=0 # Since table "a" is already defined, it can't be replaced by an inline table. a={} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-02.toml000066400000000000000000000000771513070226000332370ustar00rootroot00000000000000a={} # Inline tables are immutable and can't be extended [a.b] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-03.toml000066400000000000000000000000261513070226000332320ustar00rootroot00000000000000a = { b = 1 } a.b = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-04.toml000066400000000000000000000000541513070226000332340ustar00rootroot00000000000000inline-t = { nest = {} } [[inline-t.nest]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-05.toml000066400000000000000000000000521513070226000332330ustar00rootroot00000000000000inline-t = { nest = {} } [inline-t.nest] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-06.toml000066400000000000000000000000271513070226000332360ustar00rootroot00000000000000a = { b = 1, b.c = 2 } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-07.toml000066400000000000000000000000651513070226000332410ustar00rootroot00000000000000tab = { inner.table = [{}], inner.table.val = "bad" }hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-08.toml000066400000000000000000000000671513070226000332440ustar00rootroot00000000000000tab = { inner = { dog = "best" }, inner.cat = "worst" }hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-09.toml000066400000000000000000000001061513070226000332370ustar00rootroot00000000000000[tab.nested] inline-t = { nest = {} } [tab] nested.inline-t.nest = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/inline-table/overwrite-10.toml000066400000000000000000000002521513070226000332310ustar00rootroot00000000000000# Set implicit "b", overwrite "b" (illegal!) and then set another implicit. # # Caused panic: https://github.com/BurntSushi/toml/issues/403 a = {b.a = 1, b = 2, b.c = 3} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/000077500000000000000000000000001513070226000271635ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/capital-bin.toml000066400000000000000000000000221513070226000322350ustar00rootroot00000000000000capital-bin = 0B0 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/capital-hex.toml000066400000000000000000000000221513070226000322510ustar00rootroot00000000000000capital-hex = 0X1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/capital-oct.toml000066400000000000000000000000221513070226000322520ustar00rootroot00000000000000capital-oct = 0O0 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/double-sign-nex.toml000066400000000000000000000000271513070226000330570ustar00rootroot00000000000000double-sign-nex = --99 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/double-sign-plus.toml000066400000000000000000000000301513070226000332420ustar00rootroot00000000000000double-sign-plus = ++99 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/double-us.toml000066400000000000000000000000221513070226000317510ustar00rootroot00000000000000double-us = 1__23 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/incomplete-bin.toml000066400000000000000000000000241513070226000327610ustar00rootroot00000000000000incomplete-bin = 0b hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/incomplete-hex.toml000066400000000000000000000000241513070226000327750ustar00rootroot00000000000000incomplete-hex = 0x hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/incomplete-oct.toml000066400000000000000000000000241513070226000327760ustar00rootroot00000000000000incomplete-oct = 0o hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/invalid-bin.toml000066400000000000000000000000251513070226000322510ustar00rootroot00000000000000invalid-bin = 0b0012 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/invalid-hex-01.toml000066400000000000000000000000301513070226000324770ustar00rootroot00000000000000invalid-hex-01 = 0xaafz hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/invalid-hex-02.toml000066400000000000000000000000351513070226000325050ustar00rootroot00000000000000invalid-hex-02 = 0xgabba00f1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/invalid-hex-03.toml000066400000000000000000000000111513070226000325000ustar00rootroot00000000000000a = 0x-1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/invalid-oct.toml000066400000000000000000000000241513070226000322650ustar00rootroot00000000000000invalid-oct = 0o778 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-us-bin.toml000066400000000000000000000000261513070226000326540ustar00rootroot00000000000000leading-us-bin = _0b1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-us-hex.toml000066400000000000000000000000261513070226000326700ustar00rootroot00000000000000leading-us-hex = _0x1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-us-oct.toml000066400000000000000000000000261513070226000326710ustar00rootroot00000000000000leading-us-oct = _0o1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-us.toml000066400000000000000000000000221513070226000321020ustar00rootroot00000000000000leading-us = _123 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-zero-01.toml000066400000000000000000000000251513070226000326530ustar00rootroot00000000000000leading-zero-01 = 01 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-zero-02.toml000066400000000000000000000000251513070226000326540ustar00rootroot00000000000000leading-zero-02 = 00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/leading-zero-03.toml000066400000000000000000000000261513070226000326560ustar00rootroot00000000000000leading-zero-03 = 0_0 leading-zero-sign-01.toml000066400000000000000000000000331513070226000335310ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integerleading-zero-sign-01 = -01 leading-zero-sign-02.toml000066400000000000000000000000331513070226000335320ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integerleading-zero-sign-02 = +01 leading-zero-sign-03.toml000066400000000000000000000000341513070226000335340ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integerleading-zero-sign-03 = +0_1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/negative-bin.toml000066400000000000000000000000331513070226000324240ustar00rootroot00000000000000negative-bin = -0b11010110 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/negative-hex.toml000066400000000000000000000000251513070226000324410ustar00rootroot00000000000000negative-hex = -0xff hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/negative-oct.toml000066400000000000000000000000261513070226000324430ustar00rootroot00000000000000negative-oct = -0o755 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/positive-bin.toml000066400000000000000000000000331513070226000324640ustar00rootroot00000000000000positive-bin = +0b11010110 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/positive-hex.toml000066400000000000000000000000251513070226000325010ustar00rootroot00000000000000positive-hex = +0xff hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/positive-oct.toml000066400000000000000000000000261513070226000325030ustar00rootroot00000000000000positive-oct = +0o755 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/text-after-integer.toml000066400000000000000000000000411513070226000335710ustar00rootroot00000000000000answer = 42 the ultimate answer? hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/trailing-us-bin.toml000066400000000000000000000000271513070226000330630ustar00rootroot00000000000000trailing-us-bin = 0b1_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/trailing-us-hex.toml000066400000000000000000000000271513070226000330770ustar00rootroot00000000000000trailing-us-hex = 0x1_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/trailing-us-oct.toml000066400000000000000000000000271513070226000331000ustar00rootroot00000000000000trailing-us-oct = 0o1_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/trailing-us.toml000066400000000000000000000000231513070226000323110ustar00rootroot00000000000000trailing-us = 123_ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/us-after-bin.toml000066400000000000000000000000241513070226000323500ustar00rootroot00000000000000us-after-bin = 0b_1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/us-after-hex.toml000066400000000000000000000000241513070226000323640ustar00rootroot00000000000000us-after-hex = 0x_1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/integer/us-after-oct.toml000066400000000000000000000000241513070226000323650ustar00rootroot00000000000000us-after-oct = 0o_1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/000077500000000000000000000000001513070226000263165ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/after-array.toml000066400000000000000000000000401513070226000314220ustar00rootroot00000000000000[[agencies]] owner = "S Cjelli" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/after-table.toml000066400000000000000000000000441513070226000313770ustar00rootroot00000000000000[error] this = "should not be here" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/after-value.toml000066400000000000000000000000601513070226000314220ustar00rootroot00000000000000first = "Tom" last = "Preston-Werner" # INVALID bare-invalid-character-01.toml000066400000000000000000000000101513070226000336300ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key! = 123 bare-invalid-character-02.toml000066400000000000000000000000171513070226000336400ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/keybare!key = 123 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/dot.toml000066400000000000000000000000061513070226000277750ustar00rootroot00000000000000. = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/dotdot.toml000066400000000000000000000000071513070226000305050ustar00rootroot00000000000000.. = 1 dotted-redefine-table-01.toml000066400000000000000000000000251513070226000334760ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/keya = false a.b = true dotted-redefine-table-02.toml000066400000000000000000000001141513070226000334760ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key# Defined a.b as int a.b = 1 # Tries to access it as table: error a.b.c = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-01.toml000066400000000000000000000000361513070226000323530ustar00rootroot00000000000000name = "Tom" name = "Pradyun" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-02.toml000066400000000000000000000000311513070226000323470ustar00rootroot00000000000000dupe = false dupe = true hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-03.toml000066400000000000000000000000611513070226000323530ustar00rootroot00000000000000spelling = "favorite" "spelling" = "favourite" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-04.toml000066400000000000000000000000611513070226000323540ustar00rootroot00000000000000spelling = "favorite" 'spelling' = "favourite" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-05.toml000066400000000000000000000000321513070226000323530ustar00rootroot00000000000000a = 1 "\u0061" = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-06.toml000066400000000000000000000000361513070226000323600ustar00rootroot00000000000000"a'b" = 1 "a\u0027b" = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-07.toml000066400000000000000000000000161513070226000323570ustar00rootroot00000000000000"" = 1 "" = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-08.toml000066400000000000000000000000241513070226000323570ustar00rootroot00000000000000arr = [1] arr = [2] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/duplicate-keys-09.toml000066400000000000000000000000311513070226000323560ustar00rootroot00000000000000tbl = {k=1} tbl = {kk=2} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/empty.toml000066400000000000000000000000051513070226000303440ustar00rootroot00000000000000 = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/end-in-escape.toml000066400000000000000000000000351513070226000316210ustar00rootroot00000000000000"backslash is the last char\ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/escape.toml000066400000000000000000000000551513070226000304530ustar00rootroot00000000000000\u00c0 = "latin capital letter A with grave" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/hash.toml000066400000000000000000000000071513070226000301330ustar00rootroot00000000000000a# = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/multiline-key-01.toml000066400000000000000000000000161513070226000322160ustar00rootroot00000000000000"""key""" = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/multiline-key-02.toml000066400000000000000000000000161513070226000322170ustar00rootroot00000000000000'''key''' = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/multiline-key-03.toml000066400000000000000000000000241513070226000322170ustar00rootroot00000000000000"""key""" = """v""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/multiline-key-04.toml000066400000000000000000000000241513070226000322200ustar00rootroot00000000000000'''key''' = '''v''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-01.toml000066400000000000000000000000171513070226000310700ustar00rootroot00000000000000barekey = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-02.toml000066400000000000000000000000211513070226000310640ustar00rootroot00000000000000"quoted key" = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-03.toml000066400000000000000000000000211513070226000310650ustar00rootroot00000000000000'quoted key' = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-04.toml000066400000000000000000000000231513070226000310700ustar00rootroot00000000000000"""long key""" = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-05.toml000066400000000000000000000000231513070226000310710ustar00rootroot00000000000000'''long key''' = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/newline-06.toml000066400000000000000000000000101513070226000310660ustar00rootroot00000000000000key = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-01.toml000066400000000000000000000000141513070226000306150ustar00rootroot00000000000000a = 1 b = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-02.toml000066400000000000000000000000131513070226000306150ustar00rootroot000000000000000=0r=false hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-03.toml000066400000000000000000000000511513070226000306200ustar00rootroot000000000000000=""o=""m=""r=""00="0"q="""0"""e="""0""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-04.toml000066400000000000000000000000661513070226000306270ustar00rootroot00000000000000[[0000l0]] 0="0"[[0000l0]] 0="0"[[0000l0]] 0="0"l="0" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-05.toml000066400000000000000000000001141513070226000306220ustar00rootroot000000000000000=[0]00=[0,0,0]t=["0","0","0"]s=[1000-00-00T00:00:00Z,2000-00-00T00:00:00Z] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-06.toml000066400000000000000000000000171513070226000306250ustar00rootroot000000000000000=0r0=0r=false hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/no-eol-07.toml000066400000000000000000000000301513070226000306210ustar00rootroot000000000000000=0r0=0r=falsefal=false hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/only-float.toml000066400000000000000000000000041513070226000312710ustar00rootroot000000000000001.1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/only-int.toml000066400000000000000000000000021513070226000307540ustar00rootroot000000000000001 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/only-str.toml000066400000000000000000000000031513070226000307730ustar00rootroot00000000000000"" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/open-bracket.toml000066400000000000000000000000111513070226000315550ustar00rootroot00000000000000[abc = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/partial-quoted.toml000066400000000000000000000000241513070226000321420ustar00rootroot00000000000000partial"quoted" = 5 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/quoted-unclosed-01.toml000066400000000000000000000000111513070226000325340ustar00rootroot00000000000000"key = x hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/quoted-unclosed-02.toml000066400000000000000000000000051513070226000325400ustar00rootroot00000000000000"key hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/single-open-bracket.toml000066400000000000000000000000021513070226000330340ustar00rootroot00000000000000[ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/space.toml000066400000000000000000000000101513070226000302750ustar00rootroot00000000000000a b = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/special-character.toml000066400000000000000000000000351513070226000325630ustar00rootroot00000000000000μ = "greek small letter mu" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/start-bracket.toml000066400000000000000000000000211513070226000317520ustar00rootroot00000000000000[a] [xyz = 5 [b] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/start-dot.toml000066400000000000000000000000111513070226000311240ustar00rootroot00000000000000.key = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/two-equals-01.toml000066400000000000000000000000111513070226000315220ustar00rootroot00000000000000key= = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/two-equals-02.toml000066400000000000000000000000051513070226000315260ustar00rootroot00000000000000a==1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/two-equals-03.toml000066400000000000000000000000061513070226000315300ustar00rootroot00000000000000a=b=1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-01.toml000066400000000000000000000000041513070226000322400ustar00rootroot00000000000000key hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-02.toml000066400000000000000000000000071513070226000322440ustar00rootroot00000000000000key = hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-03.toml000066400000000000000000000000061513070226000322440ustar00rootroot00000000000000"key" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-04.toml000066400000000000000000000000111513070226000322410ustar00rootroot00000000000000"key" = hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-05.toml000066400000000000000000000000061513070226000322460ustar00rootroot00000000000000fs.fw hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-06.toml000066400000000000000000000000101513070226000322420ustar00rootroot00000000000000fs.fw = hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/key/without-value-07.toml000066400000000000000000000000041513070226000322460ustar00rootroot00000000000000fs. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/000077500000000000000000000000001513070226000275335ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/day-1digit.toml000066400000000000000000000000201513070226000323540ustar00rootroot00000000000000foo = 1997-09-9 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/feb-29.toml000066400000000000000000000000371513070226000314140ustar00rootroot00000000000000"not a leap year" = 2100-02-29 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/feb-30.toml000066400000000000000000000000571513070226000314060ustar00rootroot00000000000000"only 28 or 29 days in february" = 1988-02-30 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/mday-over.toml000066400000000000000000000001721513070226000323330ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-32 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/mday-under.toml000066400000000000000000000001721513070226000324750ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/month-over.toml000066400000000000000000000000631513070226000325250ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2006-13-01 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/month-under.toml000066400000000000000000000000631513070226000326670ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2007-00-01 no-leads-with-milli.toml000066400000000000000000000001201513070226000341210ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date# Day "5" instead of "05"; the leading zero is required. with-milli = 1987-07-5 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/no-leads.toml000066400000000000000000000001201513070226000321230ustar00rootroot00000000000000# Month "7" instead of "07"; the leading zero is required. no-leads = 1987-7-05 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/trailing-t.toml000066400000000000000000000000621513070226000325000ustar00rootroot00000000000000# Date cannot end with trailing T d = 2006-01-30T hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/y10k.toml000066400000000000000000000000601513070226000312100ustar00rootroot00000000000000# Maximum RFC3399 year is 9999. d = 10000-01-01 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-date/year-3digits.toml000066400000000000000000000000201513070226000327240ustar00rootroot00000000000000foo = 199-09-09 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/000077500000000000000000000000001513070226000304125ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/feb-29.toml000066400000000000000000000000501513070226000322660ustar00rootroot00000000000000"not a leap year" = 2100-02-29T15:15:15 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/feb-30.toml000066400000000000000000000000701513070226000322600ustar00rootroot00000000000000"only 28 or 29 days in february" = 1988-02-30T15:15:15 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/hour-over.toml000066400000000000000000000000741513070226000332360ustar00rootroot00000000000000# time-hour = 2DIGIT ; 00-23 d = 2006-01-01T24:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/mday-over.toml000066400000000000000000000002031513070226000332050ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-32T00:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/mday-under.toml000066400000000000000000000002031513070226000333470ustar00rootroot00000000000000# date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on # ; month/year d = 2006-01-00T00:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/minute-over.toml000066400000000000000000000000741513070226000335620ustar00rootroot00000000000000# time-minute = 2DIGIT ; 00-59 d = 2006-01-01T00:60:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/month-over.toml000066400000000000000000000000741513070226000334060ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2006-13-01T00:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/month-under.toml000066400000000000000000000000741513070226000335500ustar00rootroot00000000000000# date-month = 2DIGIT ; 01-12 d = 2007-00-01T00:00:00 no-leads-with-milli.toml000066400000000000000000000001341513070226000350050ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime# Day "5" instead of "05"; the leading zero is required. with-milli = 1987-07-5T17:45:00.12 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/no-leads.toml000066400000000000000000000001311513070226000330040ustar00rootroot00000000000000# Month "7" instead of "07"; the leading zero is required. no-leads = 1987-7-05T17:45:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/no-t.toml000066400000000000000000000001051513070226000321600ustar00rootroot00000000000000# No "t" or "T" between the date and time. no-t = 1987-07-0517:45:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/second-over.toml000066400000000000000000000002031513070226000335260ustar00rootroot00000000000000# time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second # ; rules d = 2006-01-01T00:00:61 time-no-leads.toml000066400000000000000000000000701513070226000336630ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime# Leading 0 is always required. d = 2023-10-01T1:32:00Z hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-datetime/y10k.toml000066400000000000000000000000711513070226000320710ustar00rootroot00000000000000# Maximum RFC3399 year is 9999. d = 10000-01-01 00:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/000077500000000000000000000000001513070226000275545ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/hour-over.toml000066400000000000000000000000611513070226000323740ustar00rootroot00000000000000# time-hour = 2DIGIT ; 00-23 d = 24:00:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/minute-over.toml000066400000000000000000000000611513070226000327200ustar00rootroot00000000000000# time-minute = 2DIGIT ; 00-59 d = 00:60:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/second-over.toml000066400000000000000000000001701513070226000326730ustar00rootroot00000000000000# time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second # ; rules d = 00:00:61 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/time-no-leads-01.toml000066400000000000000000000000541513070226000333240ustar00rootroot00000000000000# Leading 0 is always required. d = 1:32:00 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/time-no-leads-02.toml000066400000000000000000000000541513070226000333250ustar00rootroot00000000000000# Leading 0 is always required. d = 01:32:0 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/trailing-dot.toml000066400000000000000000000000161513070226000330430ustar00rootroot00000000000000t = 12:13:14. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/local-time/trailing-dotdot.toml000066400000000000000000000000171513070226000335530ustar00rootroot00000000000000t = 12:13:14.. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/000077500000000000000000000000001513070226000271135ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-16-0.toml000066400000000000000000000005511513070226000316620ustar00rootroot00000000000000str4 = """Here are two quotation marks: "". Simple enough.""" str5 = """Here are three quotation marks: """.""" # INVALID str5 = """Here are three quotation marks: ""\".""" str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" # "This," she said, "is just a pointless statement." str7 = """"This," she said, "is just a pointless statement."""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-19-0.toml000066400000000000000000000004421513070226000316640ustar00rootroot00000000000000quot15 = '''Here are fifteen quotation marks: """""""""""""""''' apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID apos15 = "Here are fifteen apostrophes: '''''''''''''''" # 'That,' she said, 'is still pointless.' str = ''''That,' she said, 'is still pointless.'''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-2.toml000066400000000000000000000000201513070226000314270ustar00rootroot00000000000000key = # INVALID hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-46-0.toml000066400000000000000000000002571513070226000316700ustar00rootroot00000000000000[fruit] apple.color = "red" apple.taste.sweet = true [fruit.apple] # INVALID # [fruit.apple.taste] # INVALID [fruit.apple.texture] # you can add sub-tables smooth = true hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-46-1.toml000066400000000000000000000002571513070226000316710ustar00rootroot00000000000000[fruit] apple.color = "red" apple.taste.sweet = true # [fruit.apple] # INVALID [fruit.apple.taste] # INVALID [fruit.apple.texture] # you can add sub-tables smooth = true hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-49-0.toml000066400000000000000000000001021513070226000316600ustar00rootroot00000000000000[product] type = { name = "Nail" } type.edible = false # INVALID hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-5.toml000066400000000000000000000002541513070226000314430ustar00rootroot00000000000000= "no key name" # INVALID """key""" = "not allowed" # INVALID "" = "blank" # VALID but discouraged '' = 'blank' # VALID but discouraged hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/spec-1.1.0/common-50-0.toml000066400000000000000000000001021513070226000316500ustar00rootroot00000000000000[product] type.name = "Nail" type = { edible = false } # INVALID hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/000077500000000000000000000000001513070226000270345ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-byte-escape.toml000066400000000000000000000000211513070226000326470ustar00rootroot00000000000000naughty = "\xAg" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-concat.toml000066400000000000000000000000351513070226000317220ustar00rootroot00000000000000no_concat = "first" "second" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-escape-01.toml000066400000000000000000000000761513070226000321360ustar00rootroot00000000000000invalid-escape = "This string has a bad \a escape character." hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-escape-02.toml000066400000000000000000000000771513070226000321400ustar00rootroot00000000000000invalid-escape = "This string has a bad \ escape character." hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-escape-03.toml000066400000000000000000000000201513070226000321250ustar00rootroot00000000000000backslash = "\" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-escape-04.toml000066400000000000000000000000161513070226000321330ustar00rootroot00000000000000a = "a \\\ b" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-escape-05.toml000066400000000000000000000000201513070226000321270ustar00rootroot00000000000000a = "a \\\\\ b" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-hex-esc-01.toml000066400000000000000000000000301513070226000322200ustar00rootroot00000000000000bad-hex-esc-01 = "\x0g" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-hex-esc-02.toml000066400000000000000000000000301513070226000322210ustar00rootroot00000000000000bad-hex-esc-02 = "\xG0" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-hex-esc-03.toml000066400000000000000000000000261513070226000322270ustar00rootroot00000000000000bad-hex-esc-03 = "\x" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-hex-esc-04.toml000066400000000000000000000000311513070226000322240ustar00rootroot00000000000000bad-hex-esc-04 = "\x 50" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-hex-esc-05.toml000066400000000000000000000000301513070226000322240ustar00rootroot00000000000000bad-hex-esc-5 = "\x 50" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-multiline.toml000066400000000000000000000000411513070226000324520ustar00rootroot00000000000000multi = "first line second line" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-slash-escape.toml000066400000000000000000000000761513070226000330300ustar00rootroot00000000000000invalid-escape = "This string has a bad \/ escape character." hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-01.toml000066400000000000000000000000321513070226000322310ustar00rootroot00000000000000bad-uni-esc-01 = "val\ue" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-02.toml000066400000000000000000000000321513070226000322320ustar00rootroot00000000000000bad-uni-esc-02 = "val\Ux" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-03.toml000066400000000000000000000000401513070226000322320ustar00rootroot00000000000000bad-uni-esc-03 = "val\U0000000" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-04.toml000066400000000000000000000000351513070226000322370ustar00rootroot00000000000000bad-uni-esc-04 = "val\U0000" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-05.toml000066400000000000000000000000411513070226000322350ustar00rootroot00000000000000bad-uni-esc-05 = "val\Ugggggggg" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-06.toml000066400000000000000000000001161513070226000322410ustar00rootroot00000000000000bad-uni-esc-06 = "This string contains a non scalar unicode codepoint \uD801" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-07.toml000066400000000000000000000000321513070226000322370ustar00rootroot00000000000000bad-uni-esc-07 = "\uabag" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-01.toml000066400000000000000000000000411513070226000326370ustar00rootroot00000000000000bad-uni-esc-ml-01 = """val\ue""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-02.toml000066400000000000000000000000411513070226000326400ustar00rootroot00000000000000bad-uni-esc-ml-02 = """val\Ux""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-03.toml000066400000000000000000000000471513070226000326470ustar00rootroot00000000000000bad-uni-esc-ml-03 = """val\U0000000""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-04.toml000066400000000000000000000000441513070226000326450ustar00rootroot00000000000000bad-uni-esc-ml-04 = """val\U0000""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-05.toml000066400000000000000000000000501513070226000326430ustar00rootroot00000000000000bad-uni-esc-ml-05 = """val\Ugggggggg""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-06.toml000066400000000000000000000001251513070226000326470ustar00rootroot00000000000000bad-uni-esc-ml-06 = """This string contains a non scalar unicode codepoint \uD801""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/bad-uni-esc-ml-07.toml000066400000000000000000000000411513070226000326450ustar00rootroot00000000000000bad-uni-esc-ml-07 = """\uabag""" basic-multiline-out-of-range-unicode-escape-01.toml000066400000000000000000000000251513070226000403310ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = """\UFFFFFFFF""" basic-multiline-out-of-range-unicode-escape-02.toml000066400000000000000000000000251513070226000403320ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = """\U00D80000""" basic-multiline-quotes.toml000066400000000000000000000000621513070226000342470ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringstr5 = """Here are three quotation marks: """.""" basic-multiline-unknown-escape.toml000066400000000000000000000000151513070226000356620ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = """\@""" basic-out-of-range-unicode-escape-01.toml000066400000000000000000000000211513070226000363250ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = "\UFFFFFFFF" basic-out-of-range-unicode-escape-02.toml000066400000000000000000000000211513070226000363260ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = "\U00D80000" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/basic-unknown-escape.toml000066400000000000000000000000111513070226000337350ustar00rootroot00000000000000a = "\@" literal-multiline-quotes-01.toml000066400000000000000000000000361513070226000350410ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = '''6 apostrophes: '''''' literal-multiline-quotes-02.toml000066400000000000000000000000521513070226000350400ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = '''15 apostrophes: '''''''''''''''''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/missing-quotes-array.toml000066400000000000000000000000171513070226000340320ustar00rootroot00000000000000name = [value] missing-quotes-inline-table.toml000066400000000000000000000000271513070226000352010ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringname = { key = value } hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/missing-quotes.toml000066400000000000000000000000151513070226000327140ustar00rootroot00000000000000name = value multiline-bad-escape-01.toml000066400000000000000000000000171513070226000340520ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringk = """t\a""" multiline-bad-escape-02.toml000066400000000000000000000000611513070226000340520ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string# \ is not a valid escape. k = """t\ t""" multiline-bad-escape-03.toml000066400000000000000000000000611513070226000340530ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string# \ is not a valid escape. k = """t\ """ multiline-bad-escape-04.toml000066400000000000000000000000241513070226000340530ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringbackslash = """\""" multiline-escape-space-01.toml000066400000000000000000000000341513070226000344160ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringa = """ foo \ \n bar""" multiline-escape-space-02.toml000066400000000000000000000000351513070226000344200ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringbee = """ hee \ gee \ """ multiline-lit-no-close-01.toml000066400000000000000000000000411513070226000343700ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringinvalid = ''' this will fail multiline-lit-no-close-02.toml000066400000000000000000000000061513070226000343720ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringx=''' multiline-lit-no-close-03.toml000066400000000000000000000000501513070226000343720ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringnot-closed= ''' diibaa blibae ete eteta multiline-lit-no-close-04.toml000066400000000000000000000000251513070226000343750ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringbee = ''' hee gee '' multiline-no-close-01.toml000066400000000000000000000000411513070226000336020ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringinvalid = """ this will fail multiline-no-close-02.toml000066400000000000000000000000061513070226000336040ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringx=""" multiline-no-close-03.toml000066400000000000000000000000501513070226000336040ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringnot-closed= """ diibaa blibae ete eteta multiline-no-close-04.toml000066400000000000000000000000251513070226000336070ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringbee = """ hee gee "" multiline-no-close-05.toml000066400000000000000000000000251513070226000336100ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/stringbee = """ hee gee\ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/multiline-quotes-01.toml000066400000000000000000000000301513070226000334600ustar00rootroot00000000000000a = """6 quotes: """""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-01.toml000066400000000000000000000000521513070226000316630ustar00rootroot00000000000000no-ending-quote = "One time, at band camp hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-02.toml000066400000000000000000000000351513070226000316650ustar00rootroot00000000000000"a-string".must-be = "closed hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-03.toml000066400000000000000000000000521513070226000316650ustar00rootroot00000000000000no-ending-quote = 'One time, at band camp hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-04.toml000066400000000000000000000000351513070226000316670ustar00rootroot00000000000000'a-string'.must-be = 'closed hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-05.toml000066400000000000000000000000751513070226000316740ustar00rootroot00000000000000# No newline at end no-ending-quote = "One time, at band camphukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-06.toml000066400000000000000000000000601513070226000316670ustar00rootroot00000000000000# No newline at end "a-string".must-be = "closedhukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-07.toml000066400000000000000000000000751513070226000316760ustar00rootroot00000000000000# No newline at end no-ending-quote = 'One time, at band camphukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-08.toml000066400000000000000000000000601513070226000316710ustar00rootroot00000000000000# No newline at end 'a-string'.must-be = 'closedhukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-09.toml000066400000000000000000000000611513070226000316730ustar00rootroot00000000000000# Newlines are not allowed in "-strings. a = " " hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-close-10.toml000066400000000000000000000000611513070226000316630ustar00rootroot00000000000000# Newlines are not allowed in '-strings. a = ' ' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-01.toml000066400000000000000000000000071513070226000315170ustar00rootroot00000000000000s = a" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-02.toml000066400000000000000000000000111513070226000315130ustar00rootroot00000000000000a = [a"] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-03.toml000066400000000000000000000000071513070226000315210ustar00rootroot00000000000000s = a' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-04.toml000066400000000000000000000000111513070226000315150ustar00rootroot00000000000000a = [a'] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-05.toml000066400000000000000000000000111513070226000315160ustar00rootroot00000000000000a = a""" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-06.toml000066400000000000000000000000131513070226000315210ustar00rootroot00000000000000a = [a"""] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-07.toml000066400000000000000000000000111513070226000315200ustar00rootroot00000000000000a = a''' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/no-open-08.toml000066400000000000000000000000131513070226000315230ustar00rootroot00000000000000a = [a'''] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/text-after-string.toml000066400000000000000000000000541513070226000333170ustar00rootroot00000000000000string = "Is there life after strings?" No. hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/string/wrong-close.toml000066400000000000000000000000471513070226000321710ustar00rootroot00000000000000bad-ending-quote = "double and single' hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/000077500000000000000000000000001513070226000266155ustar00rootroot00000000000000append-with-dotted-keys-01.toml000066400000000000000000000007531513070226000343300ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table# First a.b.c defines a table: a.b.c = {z=9} # # Then we define a.b.c.t = "str" to add a str to the above table, making it: # # a.b.c = {z=9, t="..."} # # While this makes sense, logically, it was decided this is not valid TOML as # it's too confusing/convoluted. # # See: https://github.com/toml-lang/toml/issues/846 # https://github.com/toml-lang/toml/pull/859 [a.b.c] z = 9 [a] b.c.t = "Using dotted keys to add to [a.b.c] after explicitly defining it above is not allowed" append-with-dotted-keys-02.toml000066400000000000000000000004061513070226000343240ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table# This is the same issue as in injection-1.toml, except that nests one level # deeper. See that file for a more complete description. [a.b.c.d] z = 9 [a] b.c.d.k.t = "Using dotted keys to add to [a.b.c.d] after explicitly defining it above is not allowed" append-with-dotted-keys-03.toml000066400000000000000000000000251513070226000343220ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table[[a.b]] [a] b.y = 2 append-with-dotted-keys-04.toml000066400000000000000000000001411513070226000343220ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table[dependencies.foo] version = "0.16" [dependencies] libc = "0.2" [dependencies] rand = "0.3.14" append-with-dotted-keys-05.toml000066400000000000000000000000221513070226000343210ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/tablea.b.c = 1 a.b = 2 append-with-dotted-keys-06.toml000066400000000000000000000000161513070226000343250ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/tablea = 1 a.b = 2 append-with-dotted-keys-07.toml000066400000000000000000000000361513070226000343300ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/tablea = {k1 = 1, k1.name = "joe"} hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-empty.toml000066400000000000000000000000321513070226000317570ustar00rootroot00000000000000[[]] name = "Born to Run" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-implicit.toml000066400000000000000000000011561513070226000324430ustar00rootroot00000000000000# 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" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-no-close-01.toml000066400000000000000000000000371513070226000325630ustar00rootroot00000000000000[[albums] name = "Born to Run" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-no-close-02.toml000066400000000000000000000000421513070226000325600ustar00rootroot00000000000000[[closing-bracket.missing] blaa=2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-no-close-03.toml000066400000000000000000000000121513070226000325560ustar00rootroot00000000000000[[a [[b]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/array-no-close-04.toml000066400000000000000000000000121513070226000325570ustar00rootroot00000000000000[[a b = 2 bare-invalid-character-01.toml000066400000000000000000000000141513070226000341330ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table[!] k = 123 bare-invalid-character-02.toml000066400000000000000000000000231513070226000341340ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table[bare!key] k = 123 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/dot.toml000066400000000000000000000000121513070226000302710ustar00rootroot00000000000000[.] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/dotdot.toml000066400000000000000000000000131513070226000310010ustar00rootroot00000000000000[..] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-01.toml000066400000000000000000000000251513070226000324650ustar00rootroot00000000000000[a] b = 1 [a] c = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-02.toml000066400000000000000000000000631513070226000324700ustar00rootroot00000000000000[fruit] type = "apple" [fruit.type] apple = "yes" hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-03.toml000066400000000000000000000000551513070226000324720ustar00rootroot00000000000000[fruit] apple.color = "red" [[fruit.apple]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-04.toml000066400000000000000000000000651513070226000324740ustar00rootroot00000000000000[fruit] apple.color = "red" [fruit.apple] # INVALID hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-05.toml000066400000000000000000000001001513070226000324630ustar00rootroot00000000000000[fruit] apple.taste.sweet = true [fruit.apple.taste] # INVALID hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-06.toml000066400000000000000000000000161513070226000324720ustar00rootroot00000000000000[tbl] [[tbl]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-07.toml000066400000000000000000000000161513070226000324730ustar00rootroot00000000000000[[tbl]] [tbl] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-08.toml000066400000000000000000000000461513070226000324770ustar00rootroot00000000000000[a] b = { c = 2, d = {} } [a.b] c = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-09.toml000066400000000000000000000000421513070226000324740ustar00rootroot00000000000000[a] foo="bar" [a.b] foo="bar" [a] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/duplicate-key-10.toml000066400000000000000000000000171513070226000324660ustar00rootroot00000000000000a = [] [[a.b]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/empty-implicit-table.toml000066400000000000000000000000231513070226000335400ustar00rootroot00000000000000[naughty..naughty] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/empty.toml000066400000000000000000000000031513070226000306410ustar00rootroot00000000000000[] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/equals-sign.toml000066400000000000000000000000131513070226000317340ustar00rootroot00000000000000[name=bad] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/llbrace.toml000066400000000000000000000000131513070226000311100ustar00rootroot00000000000000[ [table]] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/multiline-key-01.toml000066400000000000000000000000221513070226000325120ustar00rootroot00000000000000["""tbl"""] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/multiline-key-02.toml000066400000000000000000000000221513070226000325130ustar00rootroot00000000000000['''tbl'''] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/nested-brackets-close.toml000066400000000000000000000000171513070226000336710ustar00rootroot00000000000000[a]b] zyx = 42 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/nested-brackets-open.toml000066400000000000000000000000171513070226000335250ustar00rootroot00000000000000[a[b] zyx = 42 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/newline-01.toml000066400000000000000000000000151513070226000313650ustar00rootroot00000000000000[tbl ] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/newline-02.toml000066400000000000000000000000171513070226000313700ustar00rootroot00000000000000["tbl "] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/newline-03.toml000066400000000000000000000000171513070226000313710ustar00rootroot00000000000000["tbl" ] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/newline-04.toml000066400000000000000000000000161513070226000313710ustar00rootroot00000000000000[tbl. ] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/newline-05.toml000066400000000000000000000000211513070226000313660ustar00rootroot00000000000000[tbl .sub] k = 1 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-01.toml000066400000000000000000000000411513070226000314420ustar00rootroot00000000000000[where will it end name = value hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-02.toml000066400000000000000000000000421513070226000314440ustar00rootroot00000000000000[closing-bracket.missingö blaa=2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-03.toml000066400000000000000000000000431513070226000314460ustar00rootroot00000000000000["where will it end] name = value hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-04.toml000066400000000000000000000000021513070226000314420ustar00rootroot00000000000000[ hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-05.toml000066400000000000000000000000131513070226000314450ustar00rootroot00000000000000[fwfw.wafw hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-06.toml000066400000000000000000000000161513070226000314510ustar00rootroot00000000000000[a [b] [c [d] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-07.toml000066400000000000000000000000041513070226000314470ustar00rootroot00000000000000['] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-08.toml000066400000000000000000000000061513070226000314520ustar00rootroot00000000000000['''] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/no-close-09.toml000066400000000000000000000000441513070226000314550ustar00rootroot00000000000000["where will it end""] name = value overwrite-array-in-parent.toml000066400000000000000000000000701513070226000344650ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table[[parent-table.arr]] [parent-table] not-arr = 1 arr = 2 overwrite-bool-with-array.toml000066400000000000000000000000151513070226000344730ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/tablea=true [[a]] overwrite-with-deep-table.toml000066400000000000000000000000161513070226000344270ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/tablea=1 [a.b.c.d] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/redefine-01.toml000066400000000000000000000001161513070226000315070ustar00rootroot00000000000000# Define b as int, and try to use it as a table: error [a] b = 1 [a.b] c = 2 hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/redefine-02.toml000066400000000000000000000000311513070226000315040ustar00rootroot00000000000000[t1] t2.t3.v = 0 [t1.t2] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/redefine-03.toml000066400000000000000000000000341513070226000315100ustar00rootroot00000000000000[t1] t2.t3.v = 0 [t1.t2.t3] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/rrbrace.toml000066400000000000000000000000131513070226000311240ustar00rootroot00000000000000[[table] ] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/super-twice.toml000066400000000000000000000000161513070226000317560ustar00rootroot00000000000000[a.b] [a] [a] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/text-after-table.toml000066400000000000000000000000371513070226000326620ustar00rootroot00000000000000[error] this shouldn't be here hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/trailing-dot.toml000066400000000000000000000000051513070226000321020ustar00rootroot00000000000000[a.] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/whitespace.toml000066400000000000000000000000161513070226000316430ustar00rootroot00000000000000[invalid key] hukkin-tomli-7940ff4/tests/data/invalid/_external/toml-test/invalid/table/with-pound.toml000066400000000000000000000000301513070226000316010ustar00rootroot00000000000000[key#group] answer = 42 hukkin-tomli-7940ff4/tests/data/invalid/array-missing-comma.toml000066400000000000000000000000241513070226000247370ustar00rootroot00000000000000arrr = [true false] hukkin-tomli-7940ff4/tests/data/invalid/array-of-tables/000077500000000000000000000000001513070226000231575ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/array-of-tables/overwrite-array-in-parent.toml000066400000000000000000000000701513070226000311060ustar00rootroot00000000000000[[parent-table.arr]] [parent-table] not-arr = 1 arr = 2 hukkin-tomli-7940ff4/tests/data/invalid/array-of-tables/overwrite-bool-with-aot.toml000066400000000000000000000000141513070226000305600ustar00rootroot00000000000000a=true [[a]]hukkin-tomli-7940ff4/tests/data/invalid/array/000077500000000000000000000000001513070226000213055ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/array/file-end-after-val.toml000066400000000000000000000000041513070226000255360ustar00rootroot00000000000000a=[1hukkin-tomli-7940ff4/tests/data/invalid/array/unclosed-after-item.toml000066400000000000000000000000051513070226000260440ustar00rootroot00000000000000v=[1,hukkin-tomli-7940ff4/tests/data/invalid/array/unclosed-empty.toml000066400000000000000000000000031513070226000251430ustar00rootroot00000000000000v=[hukkin-tomli-7940ff4/tests/data/invalid/basic-str-ends-in-escape.toml000066400000000000000000000000341513070226000255410ustar00rootroot00000000000000"backslash is the last char\hukkin-tomli-7940ff4/tests/data/invalid/boolean/000077500000000000000000000000001513070226000216065ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/boolean/invalid-false-casing.toml000066400000000000000000000000111513070226000264530ustar00rootroot00000000000000val=falsEhukkin-tomli-7940ff4/tests/data/invalid/boolean/invalid-true-casing.toml000066400000000000000000000000101513070226000263370ustar00rootroot00000000000000val=trUehukkin-tomli-7940ff4/tests/data/invalid/dates-and-times/000077500000000000000000000000001513070226000231465ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/dates-and-times/invalid-day.toml000066400000000000000000000000561513070226000262450ustar00rootroot00000000000000"only 28 or 29 days in february" = 1988-02-30 hukkin-tomli-7940ff4/tests/data/invalid/dotted-keys/000077500000000000000000000000001513070226000224235ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/dotted-keys/access-non-table.toml000066400000000000000000000000241513070226000264320ustar00rootroot00000000000000a = false a.b = truehukkin-tomli-7940ff4/tests/data/invalid/dotted-keys/extend-defined-aot.toml000066400000000000000000000000351513070226000267620ustar00rootroot00000000000000[[tab.arr]] [tab] arr.val1=1 hukkin-tomli-7940ff4/tests/data/invalid/dotted-keys/extend-defined-table-with-subtable.toml000066400000000000000000000000461513070226000320400ustar00rootroot00000000000000[a.b.c.d] z = 9 [a] b.c.d.k.t = 8 hukkin-tomli-7940ff4/tests/data/invalid/dotted-keys/extend-defined-table.toml000066400000000000000000000000401513070226000272620ustar00rootroot00000000000000[a.b.c] z = 9 [a] b.c.t = 9 hukkin-tomli-7940ff4/tests/data/invalid/inline-table-missing-comma.toml000066400000000000000000000000631513070226000261670ustar00rootroot00000000000000arrr = { comma-missing = true valid-toml = false } hukkin-tomli-7940ff4/tests/data/invalid/inline-table/000077500000000000000000000000001513070226000225325ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/inline-table/define-twice-in-subtable.toml000066400000000000000000000000551513070226000301750ustar00rootroot00000000000000table1 = { table2.dupe = 1, table2.dupe = 2 }hukkin-tomli-7940ff4/tests/data/invalid/inline-table/define-twice.toml000066400000000000000000000000361513070226000257710ustar00rootroot00000000000000table = { dupe = 1, dupe = 2 }hukkin-tomli-7940ff4/tests/data/invalid/inline-table/file-end-after-key-val.toml000066400000000000000000000000061513070226000275530ustar00rootroot00000000000000a={b=1hukkin-tomli-7940ff4/tests/data/invalid/inline-table/mutate.toml000066400000000000000000000000251513070226000247230ustar00rootroot00000000000000a = { b = 1 } a.b = 2hukkin-tomli-7940ff4/tests/data/invalid/inline-table/override-val-in-table.toml000066400000000000000000000001061513070226000275140ustar00rootroot00000000000000[tab.nested] inline-t = { nest = {} } [tab] nested.inline-t.nest = 2 hukkin-tomli-7940ff4/tests/data/invalid/inline-table/override-val-with-array.toml000066400000000000000000000000541513070226000301120ustar00rootroot00000000000000inline-t = { nest = {} } [[inline-t.nest]] hukkin-tomli-7940ff4/tests/data/invalid/inline-table/override-val-with-table.toml000066400000000000000000000000521513070226000300610ustar00rootroot00000000000000inline-t = { nest = {} } [inline-t.nest] hukkin-tomli-7940ff4/tests/data/invalid/inline-table/overwrite-implicitly.toml000066400000000000000000000000271513070226000276310ustar00rootroot00000000000000a = { b = 1, b.c = 2 } hukkin-tomli-7940ff4/tests/data/invalid/inline-table/overwrite-value-in-inner-array.toml000066400000000000000000000000651513070226000314210ustar00rootroot00000000000000tab = { inner.table = [{}], inner.table.val = "bad" }hukkin-tomli-7940ff4/tests/data/invalid/inline-table/overwrite-value-in-inner-table.toml000066400000000000000000000000671513070226000313740ustar00rootroot00000000000000tab = { inner = { dog = "best" }, inner.cat = "worst" }hukkin-tomli-7940ff4/tests/data/invalid/inline-table/unclosed-empty.toml000066400000000000000000000000031513070226000263700ustar00rootroot00000000000000a={hukkin-tomli-7940ff4/tests/data/invalid/invalid-comment-char.toml000066400000000000000000000000471513070226000250660ustar00rootroot00000000000000# form feed ( ) not allowed in commentshukkin-tomli-7940ff4/tests/data/invalid/invalid-escaped-unicode.toml000066400000000000000000000000331513070226000255340ustar00rootroot00000000000000escaped-unicode = "\uabag" hukkin-tomli-7940ff4/tests/data/invalid/invalid-hex.toml000066400000000000000000000000221513070226000232660ustar00rootroot00000000000000hex = 0xgabba00f1 hukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/000077500000000000000000000000001513070226000226455ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/ends-early-table-def.toml000066400000000000000000000000121513070226000274170ustar00rootroot00000000000000[fwfw.wafwhukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/ends-early.toml000066400000000000000000000000051513070226000256000ustar00rootroot00000000000000fs.fwhukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/no-value.toml000066400000000000000000000000151513070226000252640ustar00rootroot00000000000000why-no-value=hukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/only-ws-after-dot.toml000066400000000000000000000000031513070226000270260ustar00rootroot00000000000000fs.hukkin-tomli-7940ff4/tests/data/invalid/keys-and-vals/overwrite-with-deep-table.toml000066400000000000000000000000161513070226000305360ustar00rootroot00000000000000a=1 [a.b.c.d] hukkin-tomli-7940ff4/tests/data/invalid/literal-str/000077500000000000000000000000001513070226000224315ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/literal-str/unclosed.toml000066400000000000000000000000161513070226000251370ustar00rootroot00000000000000unclosed='dwddhukkin-tomli-7940ff4/tests/data/invalid/missing-closing-double-square-bracket.toml000066400000000000000000000000421513070226000303440ustar00rootroot00000000000000[[closing-bracket.missing] blaa=2 hukkin-tomli-7940ff4/tests/data/invalid/missing-closing-square-bracket.toml000066400000000000000000000000421513070226000270740ustar00rootroot00000000000000[closing-bracket.missingö blaa=2 hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/000077500000000000000000000000001513070226000240565ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/carriage-return.toml000066400000000000000000000001051513070226000300410ustar00rootroot00000000000000s="""cr is not an allowed line ending but we just tried to use it """hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/escape-only.toml000066400000000000000000000000161513070226000271670ustar00rootroot00000000000000bee = """\""" hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/file-ends-after-opening.toml000066400000000000000000000000051513070226000313500ustar00rootroot00000000000000a="""hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/last-line-escape.toml000066400000000000000000000000351513070226000300770ustar00rootroot00000000000000bee = """ hee \ gee \ """ hukkin-tomli-7940ff4/tests/data/invalid/multiline-basic-str/unclosed-ends-in-whitespace-escape.toml000066400000000000000000000000241513070226000335060ustar00rootroot00000000000000bee = """ hee gee\ hukkin-tomli-7940ff4/tests/data/invalid/multiline-literal-str/000077500000000000000000000000001513070226000244315ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/multiline-literal-str/file-ends-after-opening.toml000066400000000000000000000000051513070226000317230ustar00rootroot00000000000000a='''hukkin-tomli-7940ff4/tests/data/invalid/multiline-literal-str/unclosed.toml000066400000000000000000000000241513070226000271360ustar00rootroot00000000000000bee = ''' hee gee ''hukkin-tomli-7940ff4/tests/data/invalid/non-scalar-escaped.toml000066400000000000000000000000121513070226000245140ustar00rootroot00000000000000a="\ud800"hukkin-tomli-7940ff4/tests/data/invalid/table/000077500000000000000000000000001513070226000212565ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/invalid/table/eof-after-opening.toml000066400000000000000000000000011513070226000254470ustar00rootroot00000000000000[hukkin-tomli-7940ff4/tests/data/invalid/table/redefine-1.toml000066400000000000000000000000311513070226000240640ustar00rootroot00000000000000[t1] t2.t3.v = 0 [t1.t2] hukkin-tomli-7940ff4/tests/data/invalid/table/redefine-2.toml000066400000000000000000000000341513070226000240700ustar00rootroot00000000000000[t1] t2.t3.v = 0 [t1.t2.t3] hukkin-tomli-7940ff4/tests/data/invalid/unclosed-multiline-string.toml000066400000000000000000000000501513070226000261770ustar00rootroot00000000000000not-closed= """ diibaa blibae ete eteta hukkin-tomli-7940ff4/tests/data/invalid/unclosed-string.toml000066400000000000000000000000341513070226000242010ustar00rootroot00000000000000"a-string".must-be = "closedhukkin-tomli-7940ff4/tests/data/valid/000077500000000000000000000000001513070226000176405ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/000077500000000000000000000000001513070226000216215ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/000077500000000000000000000000001513070226000235515ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/LICENSE000066400000000000000000000020671513070226000245630ustar00rootroot00000000000000The 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. hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/000077500000000000000000000000001513070226000246505ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/000077500000000000000000000000001513070226000257665ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/array-subtables.json000066400000000000000000000003761513070226000317670ustar00rootroot00000000000000{ "arr": [ { "subtab": { "val": {"type": "integer", "value": "1"} } }, { "subtab": { "val": {"type": "integer", "value": "2"} } } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/array-subtables.toml000066400000000000000000000000671513070226000317660ustar00rootroot00000000000000[[arr]] [arr.subtab] val=1 [[arr]] [arr.subtab] val=2 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/array.json000066400000000000000000000014661513070226000300060ustar00rootroot00000000000000{ "comments": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ], "dates": [ {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, {"type": "datetime-local", "value": "1979-05-27T07:32:00"}, {"type": "date-local", "value": "2006-06-01"}, {"type": "time-local", "value": "11:00:00"} ], "floats": [ {"type": "float", "value": "1.1"}, {"type": "float", "value": "2.1"}, {"type": "float", "value": "3.1"} ], "ints": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "strings": [ {"type": "string", "value": "a"}, {"type": "string", "value": "b"}, {"type": "string", "value": "c"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/array.toml000066400000000000000000000003121513070226000277750ustar00rootroot00000000000000ints = [1, 2, 3, ] floats = [1.1, 2.1, 3.1] strings = ["a", "b", "c"] dates = [ 1987-07-05T17:45:00Z, 1979-05-27T07:32:00, 2006-06-01, 11:00:00, ] comments = [ 1, 2, #this is ok ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/bool.json000066400000000000000000000001531513070226000276130ustar00rootroot00000000000000{ "a": [ {"type": "bool", "value": "true"}, {"type": "bool", "value": "false"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/bool.toml000066400000000000000000000000221513070226000276100ustar00rootroot00000000000000a = [true, false] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/empty.json000066400000000000000000000000361513070226000300160ustar00rootroot00000000000000{ "thevoid": [[[[[]]]]] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/empty.toml000066400000000000000000000000251513070226000300160ustar00rootroot00000000000000thevoid = [[[[[]]]]] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/hetergeneous.json000066400000000000000000000005541513070226000313620ustar00rootroot00000000000000{ "mixed": [ [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ], [ {"type": "string", "value": "a"}, {"type": "string", "value": "b"} ], [ {"type": "float", "value": "1.1"}, {"type": "float", "value": "2.1"} ] ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/hetergeneous.toml000066400000000000000000000000511513070226000313540ustar00rootroot00000000000000mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-array.json000066400000000000000000000002201513070226000316650ustar00rootroot00000000000000{ "arrays-and-ints": [ {"type": "integer", "value": "1"}, [{"type": "string", "value": "Arrays are not integers."}] ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-array.toml000066400000000000000000000000651513070226000316760ustar00rootroot00000000000000arrays-and-ints = [1, ["Arrays are not integers."]] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-float.json000066400000000000000000000001701513070226000316600ustar00rootroot00000000000000{ "ints-and-floats": [ {"type": "integer", "value": "1"}, {"type": "float", "value": "1.1"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-float.toml000066400000000000000000000000331513070226000316600ustar00rootroot00000000000000ints-and-floats = [1, 1.1] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-string.json000066400000000000000000000001721513070226000320630ustar00rootroot00000000000000{ "strings-and-ints": [ {"type": "string", "value": "hi"}, {"type": "integer", "value": "42"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-int-string.toml000066400000000000000000000000361513070226000320640ustar00rootroot00000000000000strings-and-ints = ["hi", 42] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-string-table.json000066400000000000000000000010051513070226000323540ustar00rootroot00000000000000{ "contributors": [ {"type": "string", "value": "Foo Bar \u003cfoo@example.com\u003e"}, { "email": {"type": "string", "value": "bazqux@example.com"}, "name": {"type": "string", "value": "Baz Qux"}, "url": {"type": "string", "value": "https://example.com/bazqux"} } ], "mixed": [ { "k": {"type": "string", "value": "a"} }, {"type": "string", "value": "b"}, {"type": "integer", "value": "1"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/mixed-string-table.toml000066400000000000000000000007541513070226000323700ustar00rootroot00000000000000contributors = [ "Foo Bar ", { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } ] # Start with a table as the first element. This tests a case that some libraries # might have where they will check if the first entry is a table/map/hash/assoc # array and then encode it as a table array. This was a reasonable thing to do # before TOML 1.0 since arrays could only contain one type, but now it's no # longer. mixed = [{k="a"}, "b", 1] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested-double.json000066400000000000000000000003501513070226000314110ustar00rootroot00000000000000{ "nest": [[ [{"type": "string", "value": "a"}], [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, [{"type": "integer", "value": "3"}] ] ]] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested-double.toml000066400000000000000000000000501513070226000314100ustar00rootroot00000000000000nest = [ [ ["a"], [1, 2, [3]] ] ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested-inline-table.json000066400000000000000000000000471513070226000325050ustar00rootroot00000000000000{ "a": [{ "b": {} }] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested-inline-table.toml000066400000000000000000000000231513070226000325010ustar00rootroot00000000000000a = [ { b = {} } ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested.json000066400000000000000000000001571513070226000301460ustar00rootroot00000000000000{ "nest": [ [{"type": "string", "value": "a"}], [{"type": "string", "value": "b"}] ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nested.toml000066400000000000000000000000261513070226000301430ustar00rootroot00000000000000nest = [["a"], ["b"]] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nospaces.json000066400000000000000000000002301513070226000304670ustar00rootroot00000000000000{ "ints": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/nospaces.toml000066400000000000000000000000171513070226000304740ustar00rootroot00000000000000ints = [1,2,3] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/open-parent-table.json000066400000000000000000000002201513070226000321700ustar00rootroot00000000000000{ "parent-table": { "not-arr": {"type": "integer", "value": "1"}, "arr": [ {}, {} ] } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/open-parent-table.toml000066400000000000000000000001051513070226000321740ustar00rootroot00000000000000[[parent-table.arr]] [[parent-table.arr]] [parent-table] not-arr = 1 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-quote-comma-01.json000066400000000000000000000002171513070226000326320ustar00rootroot00000000000000{ "title": [ {"type": "string", "value": "Client: \"XXXX\", Job: XXXX"}, {"type": "string", "value": "Code: XXXX"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-quote-comma-01.toml000066400000000000000000000000701513070226000326310ustar00rootroot00000000000000title = [ "Client: \"XXXX\", Job: XXXX", "Code: XXXX" ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-quote-comma-02.json000066400000000000000000000000701513070226000326300ustar00rootroot00000000000000{ "title": [{"type": "string", "value": " \", "}] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-quote-comma-02.toml000066400000000000000000000000241513070226000326310ustar00rootroot00000000000000title = [ " \", ",] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-with-comma-01.json000066400000000000000000000002131513070226000324440ustar00rootroot00000000000000{ "title": [ {"type": "string", "value": "Client: XXXX, Job: XXXX"}, {"type": "string", "value": "Code: XXXX"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-with-comma-01.toml000066400000000000000000000000641513070226000324520ustar00rootroot00000000000000title = [ "Client: XXXX, Job: XXXX", "Code: XXXX" ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-with-comma-02.json000066400000000000000000000002141513070226000324460ustar00rootroot00000000000000{ "title": [ {"type": "string", "value": "Client: XXXX,\nJob: XXXX"}, {"type": "string", "value": "Code: XXXX"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/string-with-comma-02.toml000066400000000000000000000000701513070226000324500ustar00rootroot00000000000000title = [ """Client: XXXX, Job: XXXX""", "Code: XXXX" ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/strings.json000066400000000000000000000003351513070226000303530ustar00rootroot00000000000000{ "string_array": [ {"type": "string", "value": "all"}, {"type": "string", "value": "strings"}, {"type": "string", "value": "are the same"}, {"type": "string", "value": "type"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/strings.toml000066400000000000000000000001031513070226000303460ustar00rootroot00000000000000string_array = [ "all", 'strings', """are the same""", '''type'''] table-array-string-backslash.json000066400000000000000000000001231513070226000342360ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array{ "foo": [{ "bar": {"type": "string", "value": "\"{{baz}}\""} }] } table-array-string-backslash.toml000066400000000000000000000000371513070226000342440ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/arrayfoo = [ { bar="\"{{baz}}\""} ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/trailing-comma.json000066400000000000000000000004751513070226000315720ustar00rootroot00000000000000{ "arr-1": [{"type": "integer", "value": "1"}], "arr-3": [{"type": "integer", "value": "4"}], "arr-2": [ {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "arr-4": [ {"type": "integer", "value": "5"}, {"type": "integer", "value": "6"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/array/trailing-comma.toml000066400000000000000000000001011513070226000315560ustar00rootroot00000000000000arr-1 = [1,] arr-2 = [2,3,] arr-3 = [4, ] arr-4 = [ 5, 6, ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/bool/000077500000000000000000000000001513070226000256035ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/bool/bool.json000066400000000000000000000001341513070226000274270ustar00rootroot00000000000000{ "f": {"type": "bool", "value": "false"}, "t": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/bool/bool.toml000066400000000000000000000000231513070226000274260ustar00rootroot00000000000000t = true f = false hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/000077500000000000000000000000001513070226000263125ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/after-literal-no-ws.json000066400000000000000000000003041513070226000327760ustar00rootroot00000000000000{ "false": {"type": "bool", "value": "false"}, "inf": {"type": "float", "value": "inf"}, "nan": {"type": "float", "value": "nan"}, "true": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/after-literal-no-ws.toml000066400000000000000000000001071513070226000330010ustar00rootroot00000000000000inf=inf#infinity nan=nan#not a number true=true#true false=false#false hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/at-eof.json000066400000000000000000000000641513070226000303600ustar00rootroot00000000000000{ "key": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/at-eof.toml000066400000000000000000000001251513070226000303600ustar00rootroot00000000000000# This is a full-line comment key = "value" # This is a comment at the end of a line hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/at-eof2.json000066400000000000000000000000641513070226000304420ustar00rootroot00000000000000{ "key": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/at-eof2.toml000066400000000000000000000001251513070226000304420ustar00rootroot00000000000000# This is a full-line comment key = "value" # This is a comment at the end of a line hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/everywhere.json000066400000000000000000000007761513070226000314040ustar00rootroot00000000000000{ "aot": [ { "k": {"type": "integer", "value": "98"} }, { "k": {"type": "integer", "value": "99"} } ], "group": { "answer": {"type": "integer", "value": "42"}, "d": {"type": "date-local", "value": "1979-05-27"}, "dt": {"type": "datetime", "value": "1979-05-27T07:32:12-07:00"}, "more": [ {"type": "integer", "value": "42"}, {"type": "integer", "value": "42"} ] } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/everywhere.toml000066400000000000000000000012131513070226000313710ustar00rootroot00000000000000# 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. # Make sure the space between the datetime and "#" isn't lexed. dt = 1979-05-27T07:32:12-07:00 # c d = 1979-05-27 # Comment [[aot]] # Comment k = 98 # Comment [[aot]]# Comment k = 99# Comment hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/noeol.json000066400000000000000000000000031513070226000303120ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/noeol.toml000066400000000000000000000000531513070226000303210ustar00rootroot00000000000000# single comment without any eol charactershukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/nonascii.json000066400000000000000000000000031513070226000310010ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/nonascii.toml000066400000000000000000000000401513070226000310040ustar00rootroot00000000000000# ~ € ÿ ퟿  ￿ 𐀀 􏿿 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/tricky.json000066400000000000000000000022051513070226000305110ustar00rootroot00000000000000{ "hash#tag": { "#!": {"type": "string", "value": "hash bang"}, "arr5": [[[[[{"type": "string", "value": "#"}]]]]], "arr3": [ {"type": "string", "value": "#"}, {"type": "string", "value": "#"}, {"type": "string", "value": "###"} ], "arr4": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"}, {"type": "integer", "value": "4"} ], "tbl1": { "#": {"type": "string", "value": "}#"} } }, "section": { "8": {"type": "string", "value": "eight"}, "eleven": {"type": "float", "value": "11.1"}, "five": {"type": "float", "value": "5.5"}, "four": {"type": "string", "value": "# no comment\n# nor this\n#also not comment"}, "one": {"type": "string", "value": "11"}, "six": {"type": "integer", "value": "6"}, "ten": {"type": "float", "value": "1000.0"}, "three": {"type": "string", "value": "#"}, "two": {"type": "string", "value": "22#"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/comment/tricky.toml000066400000000000000000000006011513070226000305110ustar00rootroot00000000000000[section]#attached comment #[notsection] one = "11"#cmt two = "22#" three = '#' four = """# no comment # nor this #also not comment"""#is_comment five = 5.5#66 six = 6#7 8 = "eight" #nine = 99 ten = 10e2#1 eleven = 1.11e1#23 ["hash#tag"] "#!" = "hash bang" arr3 = [ "#", '#', """###""" ] arr4 = [ 1,# 9, 9, 2#,9 ,#9 3#] ,4] arr5 = [[[[#["#"], ["#"]]]]#] ] tbl1 = { "#" = '}#'}#}} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/000077500000000000000000000000001513070226000264445ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/datetime.json000066400000000000000000000002131513070226000311270ustar00rootroot00000000000000{ "lower": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, "space": {"type": "datetime", "value": "1987-07-05T17:45:00Z"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/datetime.toml000066400000000000000000000001731513070226000311360ustar00rootroot00000000000000space = 1987-07-05 17:45:00Z # ABNF is case-insensitive, both "Z" and "z" must be supported. lower = 1987-07-05t17:45:00z hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/edge.json000066400000000000000000000006771513070226000302550ustar00rootroot00000000000000{ "first-date": {"type": "date-local", "value": "0001-01-01"}, "first-local": {"type": "datetime-local", "value": "0001-01-01T00:00:00"}, "first-offset": {"type": "datetime", "value": "0001-01-01T00:00:00Z"}, "last-date": {"type": "date-local", "value": "9999-12-31"}, "last-local": {"type": "datetime-local", "value": "9999-12-31T23:59:59"}, "last-offset": {"type": "datetime", "value": "9999-12-31T23:59:59Z"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/edge.toml000066400000000000000000000003001513070226000302360ustar00rootroot00000000000000first-offset = 0001-01-01 00:00:00Z first-local = 0001-01-01 00:00:00 first-date = 0001-01-01 last-offset = 9999-12-31 23:59:59Z last-local = 9999-12-31 23:59:59 last-date = 9999-12-31 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/invalid-date-in-string.json000066400000000000000000000000701513070226000336050ustar00rootroot00000000000000{ "s": {"type": "string", "value": "2020-01-01x"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/invalid-date-in-string.toml000066400000000000000000000000221513070226000336040ustar00rootroot00000000000000s = '2020-01-01x' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/leap-year.json000066400000000000000000000007511513070226000312210ustar00rootroot00000000000000{ "2000-date": {"type": "date-local", "value": "2000-02-29"}, "2000-datetime": {"type": "datetime", "value": "2000-02-29T15:15:15Z"}, "2000-datetime-local": {"type": "datetime-local", "value": "2000-02-29T15:15:15"}, "2024-date": {"type": "date-local", "value": "2024-02-29"}, "2024-datetime": {"type": "datetime", "value": "2024-02-29T15:15:15Z"}, "2024-datetime-local": {"type": "datetime-local", "value": "2024-02-29T15:15:15"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/leap-year.toml000066400000000000000000000003551513070226000312230ustar00rootroot000000000000002000-datetime = 2000-02-29 15:15:15Z 2000-datetime-local = 2000-02-29 15:15:15 2000-date = 2000-02-29 2024-datetime = 2024-02-29 15:15:15Z 2024-datetime-local = 2024-02-29 15:15:15 2024-date = 2024-02-29 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local-date.json000066400000000000000000000001051513070226000313400ustar00rootroot00000000000000{ "bestdayever": {"type": "date-local", "value": "1987-07-05"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local-date.toml000066400000000000000000000000311513070226000313400ustar00rootroot00000000000000bestdayever = 1987-07-05 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local-time.json000066400000000000000000000002111513070226000313570ustar00rootroot00000000000000{ "besttimeever": {"type": "time-local", "value": "17:45:00"}, "milliseconds": {"type": "time-local", "value": "10:32:00.555"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local-time.toml000066400000000000000000000000641513070226000313670ustar00rootroot00000000000000besttimeever = 17:45:00 milliseconds = 10:32:00.555 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local.json000066400000000000000000000003421513070226000304300ustar00rootroot00000000000000{ "local": {"type": "datetime-local", "value": "1987-07-05T17:45:00"}, "milli": {"type": "datetime-local", "value": "1977-12-21T10:32:00.555"}, "space": {"type": "datetime-local", "value": "1987-07-05T17:45:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/local.toml000066400000000000000000000001301513070226000304250ustar00rootroot00000000000000local = 1987-07-05T17:45:00 milli = 1977-12-21T10:32:00.555 space = 1987-07-05 17:45:00 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/milliseconds.json000066400000000000000000000004551513070226000320300ustar00rootroot00000000000000{ "utc1": {"type": "datetime", "value": "1987-07-05T17:45:56.123Z"}, "utc2": {"type": "datetime", "value": "1987-07-05T17:45:56.600Z"}, "wita1": {"type": "datetime", "value": "1987-07-05T17:45:56.123+08:00"}, "wita2": {"type": "datetime", "value": "1987-07-05T17:45:56.600+08:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/milliseconds.toml000066400000000000000000000002121513070226000320210ustar00rootroot00000000000000utc1 = 1987-07-05T17:45:56.123Z utc2 = 1987-07-05T17:45:56.6Z wita1 = 1987-07-05T17:45:56.123+08:00 wita2 = 1987-07-05T17:45:56.6+08:00 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/no-seconds.json000066400000000000000000000005031513070226000314050ustar00rootroot00000000000000{ "without-seconds-1": {"type": "time-local", "value": "13:37:00"}, "without-seconds-2": {"type": "datetime", "value": "1979-05-27T07:32:00Z"}, "without-seconds-3": {"type": "datetime", "value": "1979-05-27T07:32:00-07:00"}, "without-seconds-4": {"type": "datetime-local", "value": "1979-05-27T07:32:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/no-seconds.toml000066400000000000000000000002761513070226000314160ustar00rootroot00000000000000# Seconds are optional in date-time and time. without-seconds-1 = 13:37 without-seconds-2 = 1979-05-27 07:32Z without-seconds-3 = 1979-05-27 07:32-07:00 without-seconds-4 = 1979-05-27T07:32 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/timezone.json000066400000000000000000000004361513070226000311740ustar00rootroot00000000000000{ "nzdt": {"type": "datetime", "value": "1987-07-05T17:45:56+13:00"}, "nzst": {"type": "datetime", "value": "1987-07-05T17:45:56+12:00"}, "pdt": {"type": "datetime", "value": "1987-07-05T17:45:56-05:00"}, "utc": {"type": "datetime", "value": "1987-07-05T17:45:56Z"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/datetime/timezone.toml000066400000000000000000000002061513070226000311710ustar00rootroot00000000000000utc = 1987-07-05T17:45:56Z pdt = 1987-07-05T17:45:56-05:00 nzst = 1987-07-05T17:45:56+12:00 nzdt = 1987-07-05T17:45:56+13:00 # DST hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-crlf.json000066400000000000000000000000031513070226000276160ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-crlf.toml000066400000000000000000000000021513070226000276170ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-lf.json000066400000000000000000000000031513070226000272710ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-lf.toml000066400000000000000000000000011513070226000272710ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-nothing.json000066400000000000000000000000031513070226000303360ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-nothing.toml000066400000000000000000000000001513070226000303350ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-space.json000066400000000000000000000000031513070226000277630ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-space.toml000066400000000000000000000000011513070226000277630ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-tab.json000066400000000000000000000000031513070226000274360ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/empty-tab.toml000066400000000000000000000000011513070226000274360ustar00rootroot00000000000000 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/example.json000066400000000000000000000005201513070226000271730ustar00rootroot00000000000000{ "best-day-ever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, "numtheory": { "boring": {"type": "bool", "value": "false"}, "perfection": [ {"type": "integer", "value": "6"}, {"type": "integer", "value": "28"}, {"type": "integer", "value": "496"} ] } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/example.toml000066400000000000000000000001331513070226000271750ustar00rootroot00000000000000best-day-ever = 1987-07-05T17:45:00Z [numtheory] boring = false perfection = [6, 28, 496] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/000077500000000000000000000000001513070226000257555ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/exponent.json000066400000000000000000000006671513070226000305210ustar00rootroot00000000000000{ "lower": {"type": "float", "value": "300.0"}, "minustenth": {"type": "float", "value": "-0.1"}, "neg": {"type": "float", "value": "0.03"}, "pointlower": {"type": "float", "value": "310.0"}, "pointupper": {"type": "float", "value": "310.0"}, "pos": {"type": "float", "value": "300.0"}, "upper": {"type": "float", "value": "300.0"}, "zero": {"type": "float", "value": "3.0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/exponent.toml000066400000000000000000000001621513070226000305110ustar00rootroot00000000000000lower = 3e2 upper = 3E2 neg = 3e-2 pos = 3E+2 zero = 3e0 pointlower = 3.1e2 pointupper = 3.1E2 minustenth = -1E-1 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/float.json000066400000000000000000000005261513070226000277600ustar00rootroot00000000000000{ "negpi": {"type": "float", "value": "-3.14"}, "pi": {"type": "float", "value": "3.14"}, "pospi": {"type": "float", "value": "3.14"}, "zero-intpart": {"type": "float", "value": "0.123"}, "leading-zero-fractional": {"type": "float", "value": "0.0123"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/float.toml000066400000000000000000000001341513070226000277550ustar00rootroot00000000000000pi = 3.14 pospi = +3.14 negpi = -3.14 zero-intpart = 0.123 leading-zero-fractional = 0.0123 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/inf-and-nan.json000066400000000000000000000005241513070226000307370ustar00rootroot00000000000000{ "infinity": {"type": "float", "value": "inf"}, "infinity_neg": {"type": "float", "value": "-inf"}, "infinity_plus": {"type": "float", "value": "inf"}, "nan": {"type": "float", "value": "nan"}, "nan_neg": {"type": "float", "value": "nan"}, "nan_plus": {"type": "float", "value": "nan"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/inf-and-nan.toml000066400000000000000000000003501513070226000307360ustar00rootroot00000000000000# We don't encode +nan and -nan back with the signs; many languages don't # support a sign on NaN (it doesn't really make much sense). nan = nan nan_neg = -nan nan_plus = +nan infinity = inf infinity_neg = -inf infinity_plus = +inf hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/long.json000066400000000000000000000002101513070226000276000ustar00rootroot00000000000000{ "longpi": {"type": "float", "value": "3.141592653589793"}, "neglongpi": {"type": "float", "value": "-3.141592653589793"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/long.toml000066400000000000000000000000721513070226000276100ustar00rootroot00000000000000longpi = 3.141592653589793 neglongpi = -3.141592653589793 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/max-int.json000066400000000000000000000002061513070226000302230ustar00rootroot00000000000000{ "max_float": {"type": "float", "value": "9007199254740991"}, "min_float": {"type": "float", "value": "-9007199254740991"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/max-int.toml000066400000000000000000000001661513070226000302320ustar00rootroot00000000000000# Maximum and minimum safe natural numbers. max_float = 9_007_199_254_740_991.0 min_float = -9_007_199_254_740_991.0 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/underscore.json000066400000000000000000000002531513070226000310210ustar00rootroot00000000000000{ "after": {"type": "float", "value": "3141.5927"}, "before": {"type": "float", "value": "3141.5927"}, "exponent": {"type": "float", "value": "3.0e14"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/underscore.toml000066400000000000000000000000701513070226000310200ustar00rootroot00000000000000before = 3_141.5927 after = 3141.592_7 exponent = 3e1_4 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/zero.json000066400000000000000000000006511513070226000276310ustar00rootroot00000000000000{ "exponent": {"type": "float", "value": "0"}, "exponent-signed-neg": {"type": "float", "value": "-0"}, "exponent-signed-pos": {"type": "float", "value": "0"}, "exponent-two-0": {"type": "float", "value": "0"}, "signed-neg": {"type": "float", "value": "-0"}, "signed-pos": {"type": "float", "value": "0"}, "zero": {"type": "float", "value": "0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/float/zero.toml000066400000000000000000000002121513070226000276240ustar00rootroot00000000000000zero = 0.0 signed-pos = +0.0 signed-neg = -0.0 exponent = 0e0 exponent-two-0 = 0e00 exponent-signed-pos = +0e0 exponent-signed-neg = -0e0 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-and-explicit-after.json000066400000000000000000000003021513070226000330260ustar00rootroot00000000000000{ "a": { "better": {"type": "integer", "value": "43"}, "b": { "c": { "answer": {"type": "integer", "value": "42"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-and-explicit-after.toml000066400000000000000000000000451513070226000330340ustar00rootroot00000000000000[a.b.c] answer = 42 [a] better = 43 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-and-explicit-before.json000066400000000000000000000003021513070226000331670ustar00rootroot00000000000000{ "a": { "better": {"type": "integer", "value": "43"}, "b": { "c": { "answer": {"type": "integer", "value": "42"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-and-explicit-before.toml000066400000000000000000000000451513070226000331750ustar00rootroot00000000000000[a] better = 43 [a.b.c] answer = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-groups.json000066400000000000000000000002141513070226000306670ustar00rootroot00000000000000{ "a": { "b": { "c": { "answer": {"type": "integer", "value": "42"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/implicit-groups.toml000066400000000000000000000000241513070226000306700ustar00rootroot00000000000000[a.b.c] answer = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/000077500000000000000000000000001513070226000272135ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-01.json000066400000000000000000000011751513070226000314460ustar00rootroot00000000000000{ "arr": [ { "a": {"type": "integer", "value": "1"} }, { "a": {"type": "integer", "value": "2"} } ], "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"} } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-01.toml000066400000000000000000000003101513070226000314360ustar00rootroot00000000000000arr = [ {'a'= 1}, {'a'= 2} ] people = [{first_name = "Bruce", last_name = "Springsteen"}, {first_name = "Eric", last_name = "Clapton"}, {first_name = "Bob", last_name = "Seger"}] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-02.json000066400000000000000000000000271513070226000314420ustar00rootroot00000000000000{ "a": {"a": []} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-02.toml000066400000000000000000000001541513070226000314450ustar00rootroot00000000000000# "No newlines are allowed between the curly braces unless they are valid within # a value" a = { a = [ ]} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-03.json000066400000000000000000000004021513070226000314400ustar00rootroot00000000000000{ "b": { "a": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ], "b": [ {"type": "integer", "value": "3"}, {"type": "integer", "value": "4"} ] } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/array-03.toml000066400000000000000000000000561513070226000314470ustar00rootroot00000000000000b = { a = [ 1, 2, ], b = [ 3, 4, ]} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/bool.json000066400000000000000000000001651513070226000310430ustar00rootroot00000000000000{ "a": { "a": {"type": "bool", "value": "true"}, "b": {"type": "bool", "value": "false"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/bool.toml000066400000000000000000000000321513070226000310360ustar00rootroot00000000000000a = {a = true, b = false} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/empty.json000066400000000000000000000006431513070226000312470ustar00rootroot00000000000000{ "empty1": {}, "empty2": {}, "with_cmt": {}, "empty_in_array": [ { "not_empty": {"type": "integer", "value": "1"} }, {} ], "empty_in_array2": [ {}, { "not_empty": {"type": "integer", "value": "1"} } ], "many_empty": [ {}, {}, {} ], "nested_empty": { "empty": {} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/empty.toml000066400000000000000000000003031513070226000312420ustar00rootroot00000000000000empty1 = {} empty2 = { } empty_in_array = [ { not_empty = 1 }, {} ] empty_in_array2 = [{},{not_empty=1}] many_empty = [{},{},{}] nested_empty = {"empty"={}} with_cmt ={ }#nothing here hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/end-in-bool.json000066400000000000000000000003521513070226000322110ustar00rootroot00000000000000{ "black": { "allow_prereleases": {"type": "bool", "value": "true"}, "python": {"type": "string", "value": "\u003e3.6"}, "version": {"type": "string", "value": "\u003e=18.9b0"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/end-in-bool.toml000066400000000000000000000001061513070226000322100ustar00rootroot00000000000000black = { python=">3.6", version=">=18.9b0", allow_prereleases=true } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/inline-table.json000066400000000000000000000010711513070226000324500ustar00rootroot00000000000000{ "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"} } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/inline-table.toml000066400000000000000000000002631513070226000324540ustar00rootroot00000000000000name = { first = "Tom", last = "Preston-Werner" } point = { x = 1, y = 2 } simple = { a = 1 } str-key = { "a" = 1 } table-array = [{ "a" = 1 }, { "b" = 2 }] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-01.json000066400000000000000000000007311513070226000323760ustar00rootroot00000000000000{ "a": { "a": { "b": {"type": "integer", "value": "1"} } }, "b": { "a": { "b": {"type": "integer", "value": "1"} } }, "c": { "a": { "b": {"type": "integer", "value": "1"} } }, "d": { "a": { "b": {"type": "integer", "value": "1"} } }, "e": { "a": { "b": {"type": "integer", "value": "1"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-01.toml000066400000000000000000000001701513070226000323750ustar00rootroot00000000000000a = { a.b = 1 } b = { "a"."b" = 1 } c = { a . b = 1 } d = { 'a' . "b" = 1 } e = {a.b=1} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-02.json000066400000000000000000000010221513070226000323710ustar00rootroot00000000000000{ "many": { "dots": { "here": { "dot": { "dot": { "dot": { "a": { "b": { "c": {"type": "integer", "value": "1"}, "d": {"type": "integer", "value": "2"} } } } } } } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-02.toml000066400000000000000000000000641513070226000324000ustar00rootroot00000000000000many.dots.here.dot.dot.dot = {a.b.c = 1, a.b.d = 2} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-03.json000066400000000000000000000007731513070226000324060ustar00rootroot00000000000000{ "tbl": { "a": { "b": { "c": { "d": { "e": {"type": "integer", "value": "1"} } } } }, "x": { "a": { "b": { "c": { "d": { "e": {"type": "integer", "value": "1"} } } } } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-03.toml000066400000000000000000000000571513070226000324030ustar00rootroot00000000000000[tbl] a.b.c = {d.e=1} [tbl.x] a.b.c = {d.e=1} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-04.json000066400000000000000000000011261513070226000324000ustar00rootroot00000000000000{ "arr": [ { "T": { "a": { "b": {"type": "integer", "value": "1"} } }, "t": { "a": { "b": {"type": "integer", "value": "1"} } } }, { "T": { "a": { "b": {"type": "integer", "value": "2"} } }, "t": { "a": { "b": {"type": "integer", "value": "2"} } } } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-04.toml000066400000000000000000000001011513070226000323720ustar00rootroot00000000000000[[arr]] t = {a.b=1} T = {a.b=1} [[arr]] t = {a.b=2} T = {a.b=2} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-05.json000066400000000000000000000014371513070226000324060ustar00rootroot00000000000000{ "arr-1": [{ "a": { "b": {"type": "integer", "value": "1"} } }], "arr-2": [ {"type": "string", "value": "str"}, { "a": { "b": {"type": "integer", "value": "1"} } } ], "arr-3": [ { "a": { "b": {"type": "integer", "value": "1"} } }, { "a": { "b": {"type": "integer", "value": "2"} } } ], "arr-4": [ {"type": "string", "value": "str"}, { "a": { "b": {"type": "integer", "value": "1"} } }, { "a": { "b": {"type": "integer", "value": "2"} } } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-05.toml000066400000000000000000000001651513070226000324050ustar00rootroot00000000000000arr-1 = [{a.b = 1}] arr-2 = ["str", {a.b = 1}] arr-3 = [{a.b = 1}, {a.b = 2}] arr-4 = ["str", {a.b = 1}, {a.b = 2}] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-06.json000066400000000000000000000010041513070226000323750ustar00rootroot00000000000000{ "top": { "dot": { "dot": [ { "dot": { "dot": { "dot": {"type": "integer", "value": "1"} } } }, { "dot": { "dot": { "dot": {"type": "integer", "value": "2"} } } } ] } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-06.toml000066400000000000000000000000721513070226000324030ustar00rootroot00000000000000top.dot.dot = [ {dot.dot.dot = 1}, {dot.dot.dot = 2}, ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-07.json000066400000000000000000000002231513070226000324000ustar00rootroot00000000000000{ "arr": [{ "a": {"b": [{ "c": { "d": {"type": "integer", "value": "1"} } }]} }] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/key-dotted-07.toml000066400000000000000000000000371513070226000324050ustar00rootroot00000000000000arr = [ {a.b = [{c.d = 1}]} ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/multiline.json000066400000000000000000000003741513070226000321140ustar00rootroot00000000000000{ "tbl_multiline": { "a": {"type": "integer", "value": "1"}, "b": {"type": "string", "value": "multiline\n"}, "c": {"type": "string", "value": "and yet\nanother line"}, "d": {"type": "integer", "value": "4"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/multiline.toml000066400000000000000000000001301513070226000321040ustar00rootroot00000000000000tbl_multiline = { a = 1, b = """ multiline """, c = """and yet another line""", d = 4 } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/nest.json000066400000000000000000000012501513070226000310550ustar00rootroot00000000000000{ "arr_arr_tbl_empty": [[{}]], "arr_arr_tbl_val": [[{ "one": {"type": "integer", "value": "1"} }]], "arr_arr_tbls": [[ { "one": {"type": "integer", "value": "1"} }, { "two": {"type": "integer", "value": "2"} } ]], "arr_tbl_tbl": [{ "tbl": { "one": {"type": "integer", "value": "1"} } }], "tbl_arr_tbl": {"arr_tbl": [{ "one": {"type": "integer", "value": "1"} }]}, "tbl_tbl_empty": { "tbl_0": {} }, "tbl_tbl_val": { "tbl_1": { "one": {"type": "integer", "value": "1"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/nest.toml000066400000000000000000000005641513070226000310660ustar00rootroot00000000000000tbl_tbl_empty = { tbl_0 = {} } tbl_tbl_val = { tbl_1 = { one = 1 } } tbl_arr_tbl = { arr_tbl = [ { one = 1 } ] } arr_tbl_tbl = [ { tbl = { one = 1 } } ] # Array-of-array-of-table is interesting because it can only # be represented in inline form. arr_arr_tbl_empty = [ [ {} ] ] arr_arr_tbl_val = [ [ { one = 1 } ] ] arr_arr_tbls = [ [ { one = 1 }, { two = 2 } ] ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/newline-comment.json000066400000000000000000000011501513070226000332040ustar00rootroot00000000000000{ "tbl-1": { "1": {"type": "integer", "value": "2"}, "hello": {"type": "string", "value": "world"}, "arr": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "tbl": { "k": {"type": "integer", "value": "1"} } }, "tbl-2": { "k": {"type": "string", "value": "\tHello\n\t"} }, "trailing-comma-1": { "c": {"type": "integer", "value": "1"} }, "trailing-comma-2": { "c": {"type": "integer", "value": "1"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/newline-comment.toml000066400000000000000000000007151513070226000332140ustar00rootroot00000000000000# Identical to newline.toml, but with comments that shouldn't affect the # results. trailing-comma-1 = {#comment # comment c = 1,#comment #comment }#comment trailing-comma-2 = { c = 1, }#comment tbl-1 = {#comment hello = "world",#comment 1 = 2,#comment arr = [1,#comment 2,#comment 3,#comment ],#comment tbl = {#comment k = 1,#comment }#comment }#comment tbl-2 = {#comment k = """ Hello """#comment }#comment hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/newline.json000066400000000000000000000016011513070226000315450ustar00rootroot00000000000000{ "no-newline-before-brace": { "a": {"type": "integer", "value": "1"}, "b": {"type": "integer", "value": "2"} }, "no-newline-before-brace-with-comma": { "a": {"type": "integer", "value": "1"}, "b": {"type": "integer", "value": "2"} }, "tbl-1": { "1": {"type": "integer", "value": "2"}, "hello": {"type": "string", "value": "world"}, "arr": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "tbl": { "k": {"type": "integer", "value": "1"} } }, "tbl-2": { "k": {"type": "string", "value": "\tHello\n\t"} }, "trailing-comma-1": { "c": {"type": "integer", "value": "1"} }, "trailing-comma-2": { "c": {"type": "integer", "value": "1"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/newline.toml000066400000000000000000000005711513070226000315540ustar00rootroot00000000000000# TOML 1.1 supports newlines in inline tables and trailing commas. trailing-comma-1 = { c = 1, } trailing-comma-2 = { c = 1, } tbl-1 = { hello = "world", 1 = 2, arr = [1, 2, 3, ], tbl = { k = 1, } } tbl-2 = { k = """ Hello """ } no-newline-before-brace = { a = 1, b = 2} no-newline-before-brace-with-comma = { a = 1, b = 2,} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/spaces.json000066400000000000000000000011671513070226000313710ustar00rootroot00000000000000{ "clap-1": { "version": {"type": "string", "value": "4"}, "features": [ {"type": "string", "value": "derive"}, {"type": "string", "value": "cargo"} ] }, "clap-2": { "version": {"type": "string", "value": "4"}, "features": [ {"type": "string", "value": "derive"}, {"type": "string", "value": "cargo"} ], "nest": { "a": {"type": "string", "value": "x"}, "b": [ {"type": "float", "value": "1.5"}, {"type": "float", "value": "9"} ] } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/inline-table/spaces.toml000066400000000000000000000004521513070226000313670ustar00rootroot00000000000000# https://github.com/toml-lang/toml-test/issues/146 clap-1 = { version = "4" , features = ["derive", "cargo"] } # Contains some literal tabs! clap-2 = { version = "4" , features = [ "derive" , "cargo" ] , nest = { "a" = 'x' , 'b' = [ 1.5 , 9.0 ] } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/000077500000000000000000000000001513070226000263055ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/float64-max.json000066400000000000000000000002061513070226000312400ustar00rootroot00000000000000{ "max_int": {"type": "integer", "value": "9007199254740991"}, "min_int": {"type": "integer", "value": "-9007199254740991"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/float64-max.toml000066400000000000000000000002271513070226000312450ustar00rootroot00000000000000# Maximum and minimum safe float64 natural numbers. Mainly here for # -int-as-float. max_int = 9_007_199_254_740_991 min_int = -9_007_199_254_740_991 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/integer.json000066400000000000000000000003271513070226000306370ustar00rootroot00000000000000{ "answer": {"type": "integer", "value": "42"}, "neganswer": {"type": "integer", "value": "-42"}, "posanswer": {"type": "integer", "value": "42"}, "zero": {"type": "integer", "value": "0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/integer.toml000066400000000000000000000000651513070226000306400ustar00rootroot00000000000000answer = 42 posanswer = +42 neganswer = -42 zero = 0 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/literals.json000066400000000000000000000007231513070226000310210ustar00rootroot00000000000000{ "bin1": {"type": "integer", "value": "214"}, "bin2": {"type": "integer", "value": "5"}, "hex1": {"type": "integer", "value": "3735928559"}, "hex2": {"type": "integer", "value": "3735928559"}, "hex3": {"type": "integer", "value": "3735928559"}, "hex4": {"type": "integer", "value": "2439"}, "oct1": {"type": "integer", "value": "342391"}, "oct2": {"type": "integer", "value": "493"}, "oct3": {"type": "integer", "value": "501"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/literals.toml000066400000000000000000000002271513070226000310220ustar00rootroot00000000000000bin1 = 0b11010110 bin2 = 0b1_0_1 oct1 = 0o01234567 oct2 = 0o755 oct3 = 0o7_6_5 hex1 = 0xDEADBEEF hex2 = 0xdeadbeef hex3 = 0xdead_beef hex4 = 0x00987 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/long.json000066400000000000000000000002301513070226000301320ustar00rootroot00000000000000{ "int64-max": {"type": "integer", "value": "9223372036854775807"}, "int64-max-neg": {"type": "integer", "value": "-9223372036854775808"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/long.toml000066400000000000000000000002351513070226000301410ustar00rootroot00000000000000# int64 "should" be supported, but is not mandatory. It's fine to skip this # test. int64-max = 9223372036854775807 int64-max-neg = -9223372036854775808 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/underscore.json000066400000000000000000000001471513070226000313530ustar00rootroot00000000000000{ "kilo": {"type": "integer", "value": "1000"}, "x": {"type": "integer", "value": "1111"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/underscore.toml000066400000000000000000000000311513070226000313450ustar00rootroot00000000000000kilo = 1_000 x = 1_1_1_1 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/zero.json000066400000000000000000000010371513070226000301600ustar00rootroot00000000000000{ "a2": {"type": "integer", "value": "0"}, "a3": {"type": "integer", "value": "0"}, "b1": {"type": "integer", "value": "0"}, "b2": {"type": "integer", "value": "0"}, "b3": {"type": "integer", "value": "0"}, "d1": {"type": "integer", "value": "0"}, "d2": {"type": "integer", "value": "0"}, "d3": {"type": "integer", "value": "0"}, "h1": {"type": "integer", "value": "0"}, "h2": {"type": "integer", "value": "0"}, "h3": {"type": "integer", "value": "0"}, "o1": {"type": "integer", "value": "0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/integer/zero.toml000066400000000000000000000001721513070226000301610ustar00rootroot00000000000000d1 = 0 d2 = +0 d3 = -0 h1 = 0x0 h2 = 0x00 h3 = 0x00000 o1 = 0o0 a2 = 0o00 a3 = 0o00000 b1 = 0b0 b2 = 0b00 b3 = 0b00000 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/000077500000000000000000000000001513070226000254405ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/alphanum.json000066400000000000000000000011311513070226000301340ustar00rootroot00000000000000{ "000111": {"type": "string", "value": "leading"}, "10e3": {"type": "string", "value": "false float"}, "123": {"type": "string", "value": "num"}, "34-11": {"type": "integer", "value": "23"}, "alpha": {"type": "string", "value": "a"}, "one1two2": {"type": "string", "value": "mixed"}, "under_score": {"type": "string", "value": "___"}, "with-dash": {"type": "string", "value": "dashed"}, "2018_10": { "001": {"type": "integer", "value": "1"} }, "a-a-a": { "_": {"type": "bool", "value": "false"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/alphanum.toml000066400000000000000000000002551513070226000301440ustar00rootroot00000000000000alpha = "a" 123 = "num" 000111 = "leading" 10e3 = "false float" one1two2 = "mixed" with-dash = "dashed" under_score = "___" 34-11 = 23 [2018_10] 001 = 1 [a-a-a] _ = false hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/case-sensitive.json000066400000000000000000000010361513070226000312550ustar00rootroot00000000000000{ "sectioN": {"type": "string", "value": "NN"}, "Section": { "M": {"type": "string", "value": "latin letter M"}, "name": {"type": "string", "value": "different section!!"}, "Μ": {"type": "string", "value": "greek capital letter MU"}, "μ": {"type": "string", "value": "greek small letter mu"} }, "section": { "NAME": {"type": "string", "value": "upper"}, "Name": {"type": "string", "value": "capitalized"}, "name": {"type": "string", "value": "lower"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/case-sensitive.toml000066400000000000000000000003131513070226000312540ustar00rootroot00000000000000sectioN = "NN" [section] name = "lower" NAME = "upper" Name = "capitalized" [Section] name = "different section!!" "μ" = "greek small letter mu" "Μ" = "greek capital letter MU" M = "latin letter M" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-01.json000066400000000000000000000005021513070226000300310ustar00rootroot00000000000000{ "many": { "dots": { "dot": { "dot": { "dot": {"type": "integer", "value": "42"} } } } }, "name": { "first": {"type": "string", "value": "Arthur"}, "last": {"type": "string", "value": "Dent"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-01.toml000066400000000000000000000001111513070226000300270ustar00rootroot00000000000000name.first = "Arthur" "name".'last' = "Dent" many.dots.dot.dot.dot = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-02.json000066400000000000000000000011331513070226000300330ustar00rootroot00000000000000{ "count": { "a": {"type": "integer", "value": "1"}, "b": {"type": "integer", "value": "2"}, "c": {"type": "integer", "value": "3"}, "d": {"type": "integer", "value": "4"}, "e": {"type": "integer", "value": "5"}, "f": {"type": "integer", "value": "6"}, "g": {"type": "integer", "value": "7"}, "h": {"type": "integer", "value": "8"}, "i": {"type": "integer", "value": "9"}, "j": {"type": "integer", "value": "10"}, "k": {"type": "integer", "value": "11"}, "l": {"type": "integer", "value": "12"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-02.toml000066400000000000000000000005041513070226000300360ustar00rootroot00000000000000# Note: this file contains literal tab characters. # Space are ignored, and key parts can be quoted. count.a = 1 count . b = 2 "count"."c" = 3 "count" . "d" = 4 'count'.'e' = 5 'count' . 'f' = 6 "count".'g' = 7 "count" . 'h' = 8 count.'i' = 9 count . 'j' = 10 "count".k = 11 "count" . l = 12 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-03.json000066400000000000000000000007341513070226000300420ustar00rootroot00000000000000{ "a": { "few": { "dots": { "polka": { "dance-with": {"type": "string", "value": "Dot"}, "dot": {"type": "string", "value": "again?"} } } } }, "tbl": { "a": { "b": { "c": {"type": "float", "value": "42.666"} } } }, "top": { "key": {"type": "integer", "value": "1"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-03.toml000066400000000000000000000001371513070226000300410ustar00rootroot00000000000000top.key = 1 [tbl] a.b.c = 42.666 [a.few.dots] polka.dot = "again?" polka.dance-with = "Dot" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-04.json000066400000000000000000000010071513070226000300350ustar00rootroot00000000000000{ "arr": [ { "a": { "b": { "c": {"type": "integer", "value": "1"}, "d": {"type": "integer", "value": "2"} } } }, { "a": { "b": { "c": {"type": "integer", "value": "3"}, "d": {"type": "integer", "value": "4"} } } } ], "top": { "key": {"type": "integer", "value": "1"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-04.toml000066400000000000000000000000771513070226000300450ustar00rootroot00000000000000top.key = 1 [[arr]] a.b.c=1 a.b.d=2 [[arr]] a.b.c=3 a.b.d=4 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-empty.json000066400000000000000000000003621513070226000307530ustar00rootroot00000000000000{ "": { "x": {"type": "string", "value": "empty.x"} }, "a": { "": { "": {"type": "string", "value": "empty.empty"} } }, "x": { "": {"type": "string", "value": "x.empty"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/dotted-empty.toml000066400000000000000000000000741513070226000307550ustar00rootroot00000000000000''.x = "empty.x" x."" = "x.empty" [a] "".'' = "empty.empty" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-01.json000066400000000000000000000000611513070226000277040ustar00rootroot00000000000000{ "": {"type": "string", "value": "blank"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-01.toml000066400000000000000000000000151513070226000277050ustar00rootroot00000000000000"" = "blank" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-02.json000066400000000000000000000000611513070226000277050ustar00rootroot00000000000000{ "": {"type": "string", "value": "blank"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-02.toml000066400000000000000000000000151513070226000277060ustar00rootroot00000000000000'' = "blank" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-03.json000066400000000000000000000000561513070226000277120ustar00rootroot00000000000000{ "": {"type": "integer", "value": "0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/empty-03.toml000066400000000000000000000000051513070226000277060ustar00rootroot00000000000000''=0 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/equals-nospace.json000066400000000000000000000000651513070226000312540ustar00rootroot00000000000000{ "answer": {"type": "integer", "value": "42"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/equals-nospace.toml000066400000000000000000000000121513070226000312460ustar00rootroot00000000000000answer=42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/escapes.json000066400000000000000000000006211513070226000277550ustar00rootroot00000000000000{ "\b": {"type": "string", "value": "bell"}, "\n": {"type": "string", "value": "newline"}, "\"": {"type": "string", "value": "just a quote"}, "backsp\b\b": {}, "À": {"type": "string", "value": "latin capital letter A with grave"}, "\"quoted\"": { "quote": {"type": "bool", "value": "true"} }, "a.b": { "À": {} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/escapes.toml000066400000000000000000000002431513070226000277570ustar00rootroot00000000000000"\n" = "newline" "\b" = "bell" "\u00c0" = "latin capital letter A with grave" "\"" = "just a quote" ["backsp\b\b"] ["\"quoted\""] quote = true ["a.b"."\u00c0"] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/like-date.json000066400000000000000000000016621513070226000301770ustar00rootroot00000000000000{ "15:16:17": {"type": "integer", "value": "6"}, "2001-02-03": {"type": "integer", "value": "1"}, "2001-02-04": {"type": "integer", "value": "2"}, "2001-02-05": {"type": "integer", "value": "3"}, "2001-02-06T15:16:17+01:00": {"type": "integer", "value": "4"}, "2001-02-07T15:16:17": {"type": "integer", "value": "5"}, "2002-01-04": [{ "k": {"type": "integer", "value": "12"} }], "2001-02-11": { "a": { "2001-02-12": {"type": "integer", "value": "9"} } }, "2002-01-02": { "k": {"type": "integer", "value": "10"}, "2024-01-03": { "k": {"type": "integer", "value": "11"} } }, "a": { "2001-02-08": {"type": "integer", "value": "7"}, "2001-02-09": { "2001-02-10": {"type": "integer", "value": "8"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/like-date.toml000066400000000000000000000007711513070226000302010ustar00rootroot00000000000000# '-' is a valid character in keys: make a key that looks like a date. 2001-02-03 = 1 "2001-02-04" = 2 '2001-02-05' = 3 # Also include datetime and time for good measure; these need to be quoted as # ':' isn't a valid bare key. "2001-02-06T15:16:17+01:00" = 4 "2001-02-07T15:16:17" = 5 "15:16:17" = 6 # Dotted keys a.2001-02-08 = 7 a.2001-02-09.2001-02-10 = 8 2001-02-11.a.2001-02-12 = 9 # Table names [2002-01-02] k = 10 [2002-01-02.2024-01-03] k = 11 [[2002-01-04]] k = 12 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-01.json000066400000000000000000000000571513070226000302150ustar00rootroot00000000000000{ "1": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-01.toml000066400000000000000000000000151513070226000302110ustar00rootroot000000000000001 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-02.json000066400000000000000000000001041513070226000302070ustar00rootroot00000000000000{ "1": { "2": {"type": "bool", "value": "true"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-02.toml000066400000000000000000000000151513070226000302120ustar00rootroot000000000000001.2 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-03.json000066400000000000000000000000621513070226000302130ustar00rootroot00000000000000{ "0123": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-03.toml000066400000000000000000000000151513070226000302130ustar00rootroot000000000000000123 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-04.json000066400000000000000000000001061513070226000302130ustar00rootroot00000000000000{ "01": { "23": {"type": "bool", "value": "true"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-04.toml000066400000000000000000000000151513070226000302140ustar00rootroot0000000000000001.23 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-05.json000066400000000000000000000001061513070226000302140ustar00rootroot00000000000000{ "23": { "01": {"type": "bool", "value": "true"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-05.toml000066400000000000000000000000151513070226000302150ustar00rootroot0000000000000023.01 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-06.json000066400000000000000000000000601513070226000302140ustar00rootroot00000000000000{ "-1": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-06.toml000066400000000000000000000000151513070226000302160ustar00rootroot00000000000000-1 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-07.json000066400000000000000000000000611513070226000302160ustar00rootroot00000000000000{ "-01": {"type": "bool", "value": "true"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-07.toml000066400000000000000000000000151513070226000302170ustar00rootroot00000000000000-01 = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-08.json000066400000000000000000000001441513070226000302210ustar00rootroot00000000000000{ "01": {"type": "string", "value": "zero one"}, "1": {"type": "string", "value": "one"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/numeric-08.toml000066400000000000000000000000331513070226000302200ustar00rootroot000000000000001 = 'one' 01 = 'zero one' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/quoted-dots.json000066400000000000000000000007461513070226000306120ustar00rootroot00000000000000{ "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": { "escaped.dot": {"type": "integer", "value": "7"}, "key.with.dots": {"type": "integer", "value": "6"}, "plain": {"type": "integer", "value": "5"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/quoted-dots.toml000066400000000000000000000002071513070226000306040ustar00rootroot00000000000000plain = 1 "with.dot" = 2 [plain_table] plain = 3 "with.dot" = 4 [table.withdot] plain = 5 "key.with.dots" = 6 "escaped\u002edot" = 7 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/quoted-unicode.json000066400000000000000000000006251513070226000312630ustar00rootroot00000000000000{ "\u0000": {"type": "string", "value": "null"}, "\b \f A  € ÿ ퟿  ￿ 𐀀 􏿿": {"type": "string", "value": "escaped key"}, "\\u0000": {"type": "string", "value": "different key"}, "l ~ € ÿ ퟿  ￿ 𐀀 􏿿": {"type": "string", "value": "literal key"}, "~ € ÿ ퟿  ￿ 𐀀 􏿿": {"type": "string", "value": "basic key"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/quoted-unicode.toml000066400000000000000000000003721513070226000312640ustar00rootroot00000000000000 "\u0000" = "null" '\u0000' = "different key" "\u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff" = "escaped key" "~ € ÿ ퟿  ￿ 𐀀 􏿿" = "basic key" 'l ~ € ÿ ퟿  ￿ 𐀀 􏿿' = "literal key" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/space.json000066400000000000000000000004741513070226000274330ustar00rootroot00000000000000{ " much \t\t whitespace \t\n \r\n ": {"type": "integer", "value": "3"}, " c d ": {"type": "integer", "value": "2"}, "a b": {"type": "integer", "value": "1"}, " tbl ": { "\ttab\ttab\t": {"type": "string", "value": "tab"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/space.toml000066400000000000000000000002341513070226000274270ustar00rootroot00000000000000# Keep whitespace inside quotes keys at all positions. "a b" = 1 " c d " = 2 " much whitespace \n \r\n " = 3 [ " tbl " ] "\ttab\ttab\t" = "tab" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/special-chars.json000066400000000000000000000001421513070226000310460ustar00rootroot00000000000000{ "=~!@$^\u0026*()_+-`1234567890[]|/?\u003e\u003c.,;:'=": {"type": "integer", "value": "1"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/special-chars.toml000066400000000000000000000000541513070226000310520ustar00rootroot00000000000000"=~!@$^&*()_+-`1234567890[]|/?><.,;:'=" = 1 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/special-word.json000066400000000000000000000003421513070226000307230ustar00rootroot00000000000000{ "false": {"type": "bool", "value": "false"}, "inf": {"type": "integer", "value": "100000000"}, "nan": {"type": "string", "value": "ceci n'est pas un nombre"}, "true": {"type": "integer", "value": "1"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/special-word.toml000066400000000000000000000001111513070226000307170ustar00rootroot00000000000000false = false true = 1 inf = 100000000 nan = "ceci n'est pas un nombre" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/start.json000066400000000000000000000015001513070226000274640ustar00rootroot00000000000000{ "-": { "-": {"type": "integer", "value": "4"} }, "---": { "---": {"type": "integer", "value": "7"} }, "-key": { "-key": {"type": "integer", "value": "1"} }, "1": { "1": {"type": "integer", "value": "6"} }, "111": { "111": {"type": "integer", "value": "9"} }, "1key": { "1key": {"type": "integer", "value": "3"} }, "_": { "_": {"type": "integer", "value": "5"} }, "___": { "___": {"type": "integer", "value": "8"} }, "_key": { "_key": {"type": "integer", "value": "2"} }, "inline": { "---": { "---": {"type": "integer", "value": "10"}, "111": {"type": "integer", "value": "12"}, "___": {"type": "integer", "value": "11"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/start.toml000066400000000000000000000004321513070226000274710ustar00rootroot00000000000000# Table and keys can start with any character; there is no requirement for it to # start with a letter. [-key] -key = 1 [_key] _key = 2 [1key] 1key = 3 [-] - = 4 [_] _ = 5 [1] 1 = 6 [---] --- = 7 [___] ___ = 8 [111] 111 = 9 [inline] --- = {--- = 10, ___ = 11, 111 = 12} hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/zero.json000066400000000000000000000000571513070226000273140ustar00rootroot00000000000000{ "0": {"type": "integer", "value": "0"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/key/zero.toml000066400000000000000000000000041513070226000273060ustar00rootroot000000000000000=0 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/multibyte.json000066400000000000000000000020401513070226000275550ustar00rootroot00000000000000{ "𝐭𝐛𝐥": { "string": {"type": "string", "value": "𝓼𝓽𝓻𝓲𝓷𝓰 - #"}, "sub": { "another_test_string": {"type": "string", "value": "§á₥è ƭλïñϱ, βúƭ ωïƭλ á ƨƭřïñϱ #"}, "escapes": {"type": "string", "value": " Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \""}, "βïƭ#": { "multi_line_array": [{"type": "string", "value": "]"}], "ωλáƭ?": {"type": "string", "value": "Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?"} }, "𝕒𝕣𝕣𝕒𝕪": [ {"type": "string", "value": "] "}, {"type": "string", "value": " # "} ], "𝕒𝕣𝕣𝕒𝕪𝟚": [ {"type": "string", "value": "Tèƨƭ #11 ]ƥřôƲèδ ƭλáƭ"}, {"type": "string", "value": "Éжƥèřï₥èñƭ #9 ωáƨ á ƨúççèƨƨ"} ] } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/multibyte.toml000066400000000000000000000022041513070226000275610ustar00rootroot00000000000000# Test multibyte throughout # Tèƨƭ ƒïℓè ƒôř TÓM£ # Óñℓ¥ ƭλïƨ ôñè ƭřïèƨ ƭô è₥úℓáƭè á TÓM£ ƒïℓè ωřïƭƭèñ β¥ á úƨèř ôƒ ƭλè ƙïñδ ôƒ ƥářƨèř ωřïƭèřƨ ƥřôβáβℓ¥ λáƭè ['𝐭𝐛𝐥'] string = "𝓼𝓽𝓻𝓲𝓷𝓰 - #" # " 𝓼𝓽𝓻𝓲𝓷𝓰 ['𝐭𝐛𝐥'.sub] '𝕒𝕣𝕣𝕒𝕪' = [ "] ", " # "] # ] 𝓪𝓻𝓻𝓪𝔂 '𝕒𝕣𝕣𝕒𝕪𝟚' = [ "Tèƨƭ #11 ]ƥřôƲèδ ƭλáƭ", "Éжƥèřï₥èñƭ #9 ωáƨ á ƨúççèƨƨ" ] # Ýôú δïδñ'ƭ ƭλïñƙ ïƭ'δ áƨ èáƨ¥ áƨ çλúçƙïñϱ ôúƭ ƭλè ℓáƨƭ #, δïδ ¥ôú? another_test_string = "§á₥è ƭλïñϱ, βúƭ ωïƭλ á ƨƭřïñϱ #" escapes = " Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \"" # "áñδ çô₥₥èñƭƨ ářè ƭλèřè ƭôô" # Tλïñϱƨ ωïℓℓ ϱèƭ λářδèř ['𝐭𝐛𝐥'.sub."βïƭ#"] "ωλáƭ?" = "Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?" multi_line_array = [ "]", # ] Óλ ¥èƨ Ì δïδ ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/newline-crlf.json000066400000000000000000000001521513070226000301260ustar00rootroot00000000000000{ "newline": {"type": "string", "value": "crlf"}, "os": {"type": "string", "value": "DOS"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/newline-crlf.toml000066400000000000000000000000361513070226000301310ustar00rootroot00000000000000os = "DOS" newline = "crlf" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/newline-lf.json000066400000000000000000000001511513070226000276000ustar00rootroot00000000000000{ "newline": {"type": "string", "value": "lf"}, "os": {"type": "string", "value": "unix"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/newline-lf.toml000066400000000000000000000000331513070226000276010ustar00rootroot00000000000000os = "unix" newline = "lf" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/000077500000000000000000000000001513070226000262355ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-0.json000066400000000000000000000001771513070226000305620ustar00rootroot00000000000000{ "another": {"type": "string", "value": "# This is not a comment"}, "key": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-0.toml000066400000000000000000000001721513070226000305570ustar00rootroot00000000000000# This is a full-line comment key = "value" # This is a comment at the end of a line another = "# This is not a comment" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-1.json000066400000000000000000000000641513070226000305560ustar00rootroot00000000000000{ "key": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-1.toml000066400000000000000000000000161513070226000305550ustar00rootroot00000000000000key = "value" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-10.json000066400000000000000000000005661513070226000306450ustar00rootroot00000000000000{ "apple": { "color": {"type": "string", "value": "red"}, "skin": {"type": "string", "value": "thin"}, "type": {"type": "string", "value": "fruit"} }, "orange": { "color": {"type": "string", "value": "orange"}, "skin": {"type": "string", "value": "thick"}, "type": {"type": "string", "value": "fruit"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-10.toml000066400000000000000000000002211513070226000306330ustar00rootroot00000000000000# RECOMMENDED apple.type = "fruit" apple.skin = "thin" apple.color = "red" orange.type = "fruit" orange.skin = "thick" orange.color = "orange" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-11.json000066400000000000000000000001101513070226000306270ustar00rootroot00000000000000{ "3": { "14159": {"type": "string", "value": "pi"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-11.toml000066400000000000000000000000171513070226000306370ustar00rootroot000000000000003.14159 = "pi" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-12.json000066400000000000000000000001551513070226000306410ustar00rootroot00000000000000{ "str": {"type": "string", "value": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-12.toml000066400000000000000000000001111513070226000306330ustar00rootroot00000000000000str = "I'm a string. \"You can quote me\". Name\tJos\xE9\nLocation\tSF." hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-13.json000066400000000000000000000001171513070226000306400ustar00rootroot00000000000000{ "str1": {"type": "string", "value": "Roses are red\nViolets are blue"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-13.toml000066400000000000000000000000551513070226000306430ustar00rootroot00000000000000str1 = """ Roses are red Violets are blue""" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-14.json000066400000000000000000000002351513070226000306420ustar00rootroot00000000000000{ "str2": {"type": "string", "value": "Roses are red\nViolets are blue"}, "str3": {"type": "string", "value": "Roses are red\r\nViolets are blue"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-14.toml000066400000000000000000000003431513070226000306440ustar00rootroot00000000000000# On a Unix system, the above multi-line string will most likely be the same as: str2 = "Roses are red\nViolets are blue" # On a Windows system, it will most likely be equivalent to: str3 = "Roses are red\r\nViolets are blue" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-15.json000066400000000000000000000004161513070226000306440ustar00rootroot00000000000000{ "str1": {"type": "string", "value": "The quick brown fox jumps over the lazy dog."}, "str2": {"type": "string", "value": "The quick brown fox jumps over the lazy dog."}, "str3": {"type": "string", "value": "The quick brown fox jumps over the lazy dog."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-15.toml000066400000000000000000000004231513070226000306440ustar00rootroot00000000000000# The following strings are byte-for-byte equivalent: str1 = "The quick brown fox jumps over the lazy dog." str2 = """ The quick brown \ fox jumps over \ the lazy dog.""" str3 = """\ The quick brown \ fox jumps over \ the lazy dog.\ """ hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-16.json000066400000000000000000000006071513070226000306470ustar00rootroot00000000000000{ "str4": {"type": "string", "value": "Here are two quotation marks: \"\". Simple enough."}, "str5": {"type": "string", "value": "Here are three quotation marks: \"\"\"."}, "str6": {"type": "string", "value": "Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"."}, "str7": {"type": "string", "value": "\"This,\" she said, \"is just a pointless statement.\""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-16.toml000066400000000000000000000005531513070226000306510ustar00rootroot00000000000000str4 = """Here are two quotation marks: "". Simple enough.""" # str5 = """Here are three quotation marks: """.""" # INVALID str5 = """Here are three quotation marks: ""\".""" str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" # "This," she said, "is just a pointless statement." str7 = """"This," she said, "is just a pointless statement."""" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-17.json000066400000000000000000000004641513070226000306510ustar00rootroot00000000000000{ "quoted": {"type": "string", "value": "Tom \"Dubs\" Preston-Werner"}, "regex": {"type": "string", "value": "\u003c\\i\\c*\\s*\u003e"}, "winpath": {"type": "string", "value": "C:\\Users\\nodejs\\templates"}, "winpath2": {"type": "string", "value": "\\\\ServerX\\admin$\\system32\\"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-17.toml000066400000000000000000000002561513070226000306520ustar00rootroot00000000000000# What you see is what you get. winpath = 'C:\Users\nodejs\templates' winpath2 = '\\ServerX\admin$\system32\' quoted = 'Tom "Dubs" Preston-Werner' regex = '<\i\c*\s*>' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-18.json000066400000000000000000000003341513070226000306460ustar00rootroot00000000000000{ "lines": {"type": "string", "value": "The first newline is\ntrimmed in literal strings.\n All other whitespace\n is preserved.\n"}, "regex2": {"type": "string", "value": "I [dw]on't need \\d{2} apples"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-18.toml000066400000000000000000000002271513070226000306510ustar00rootroot00000000000000regex2 = '''I [dw]on't need \d{2} apples''' lines = ''' The first newline is trimmed in literal strings. All other whitespace is preserved. ''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-19.json000066400000000000000000000004441513070226000306510ustar00rootroot00000000000000{ "apos15": {"type": "string", "value": "Here are fifteen apostrophes: '''''''''''''''"}, "quot15": {"type": "string", "value": "Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\""}, "str": {"type": "string", "value": "'That,' she said, 'is still pointless.'"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-19.toml000066400000000000000000000004441513070226000306530ustar00rootroot00000000000000quot15 = '''Here are fifteen quotation marks: """""""""""""""''' # apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID apos15 = "Here are fifteen apostrophes: '''''''''''''''" # 'That,' she said, 'is still pointless.' str = ''''That,' she said, 'is still pointless.'''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-20.json000066400000000000000000000003031513070226000306330ustar00rootroot00000000000000{ "int1": {"type": "integer", "value": "99"}, "int2": {"type": "integer", "value": "42"}, "int3": {"type": "integer", "value": "0"}, "int4": {"type": "integer", "value": "-17"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-20.toml000066400000000000000000000000511513070226000306350ustar00rootroot00000000000000int1 = +99 int2 = 42 int3 = 0 int4 = -17 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-21.json000066400000000000000000000003221513070226000306350ustar00rootroot00000000000000{ "int5": {"type": "integer", "value": "1000"}, "int6": {"type": "integer", "value": "5349221"}, "int7": {"type": "integer", "value": "5349221"}, "int8": {"type": "integer", "value": "12345"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-21.toml000066400000000000000000000001721513070226000306420ustar00rootroot00000000000000int5 = 1_000 int6 = 5_349_221 int7 = 53_49_221 # Indian number system grouping int8 = 1_2_3_4_5 # VALID but discouraged hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-22.json000066400000000000000000000005011513070226000306350ustar00rootroot00000000000000{ "bin1": {"type": "integer", "value": "214"}, "hex1": {"type": "integer", "value": "3735928559"}, "hex2": {"type": "integer", "value": "3735928559"}, "hex3": {"type": "integer", "value": "3735928559"}, "oct1": {"type": "integer", "value": "342391"}, "oct2": {"type": "integer", "value": "493"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-22.toml000066400000000000000000000003371513070226000306460ustar00rootroot00000000000000# hexadecimal with prefix `0x` hex1 = 0xDEADBEEF hex2 = 0xdeadbeef hex3 = 0xdead_beef # octal with prefix `0o` oct1 = 0o01234567 oct2 = 0o755 # useful for Unix file permissions # binary with prefix `0b` bin1 = 0b11010110 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-23.json000066400000000000000000000005331513070226000306430ustar00rootroot00000000000000{ "flt1": {"type": "float", "value": "1"}, "flt2": {"type": "float", "value": "3.1415"}, "flt3": {"type": "float", "value": "-0.01"}, "flt4": {"type": "float", "value": "5e+22"}, "flt5": {"type": "float", "value": "1e+06"}, "flt6": {"type": "float", "value": "-0.02"}, "flt7": {"type": "float", "value": "6.626e-34"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-23.toml000066400000000000000000000001771513070226000306510ustar00rootroot00000000000000# fractional flt1 = +1.0 flt2 = 3.1415 flt3 = -0.01 # exponent flt4 = 5e+22 flt5 = 1e06 flt6 = -2E-2 # both flt7 = 6.626e-34 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-24.json000066400000000000000000000000771513070226000306470ustar00rootroot00000000000000{ "flt8": {"type": "float", "value": "224617.445991228"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-24.toml000066400000000000000000000000331513070226000306410ustar00rootroot00000000000000flt8 = 224_617.445_991_228 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-25.json000066400000000000000000000004301513070226000306410ustar00rootroot00000000000000{ "sf1": {"type": "float", "value": "inf"}, "sf2": {"type": "float", "value": "inf"}, "sf3": {"type": "float", "value": "-inf"}, "sf4": {"type": "float", "value": "nan"}, "sf5": {"type": "float", "value": "nan"}, "sf6": {"type": "float", "value": "nan"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-25.toml000066400000000000000000000004241513070226000306460ustar00rootroot00000000000000# infinity sf1 = inf # positive infinity sf2 = +inf # positive infinity sf3 = -inf # negative infinity # not a number sf4 = nan # actual sNaN/qNaN encoding is implementation-specific sf5 = +nan # same as `nan` sf6 = -nan # valid, actual encoding is implementation-specific hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-26.json000066400000000000000000000001441513070226000306440ustar00rootroot00000000000000{ "bool1": {"type": "bool", "value": "true"}, "bool2": {"type": "bool", "value": "false"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-26.toml000066400000000000000000000000331513070226000306430ustar00rootroot00000000000000bool1 = true bool2 = false hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-27.json000066400000000000000000000004441513070226000306500ustar00rootroot00000000000000{ "odt1": {"type": "datetime", "value": "1979-05-27T07:32:00Z"}, "odt2": {"type": "datetime", "value": "1979-05-27T00:32:00-07:00"}, "odt3": {"type": "datetime", "value": "1979-05-27T00:32:00.5-07:00"}, "odt4": {"type": "datetime", "value": "1979-05-27T00:32:00.999-07:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-27.toml000066400000000000000000000002051513070226000306450ustar00rootroot00000000000000odt1 = 1979-05-27T07:32:00Z odt2 = 1979-05-27T00:32:00-07:00 odt3 = 1979-05-27T00:32:00.5-07:00 odt4 = 1979-05-27T00:32:00.999-07:00 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-28.json000066400000000000000000000001061513070226000306440ustar00rootroot00000000000000{ "odt4": {"type": "datetime", "value": "1979-05-27T07:32:00Z"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-28.toml000066400000000000000000000000341513070226000306460ustar00rootroot00000000000000odt4 = 1979-05-27 07:32:00Z hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-29.json000066400000000000000000000002161513070226000306470ustar00rootroot00000000000000{ "odt5": {"type": "datetime", "value": "1979-05-27T07:32:00Z"}, "odt6": {"type": "datetime", "value": "1979-05-27T07:32:00-07:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-29.toml000066400000000000000000000000671513070226000306550ustar00rootroot00000000000000odt5 = 1979-05-27 07:32Z odt6 = 1979-05-27 07:32-07:00 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-3.json000066400000000000000000000003331513070226000305570ustar00rootroot00000000000000{ "1234": {"type": "string", "value": "value"}, "bare-key": {"type": "string", "value": "value"}, "bare_key": {"type": "string", "value": "value"}, "key": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-3.toml000066400000000000000000000001031513070226000305540ustar00rootroot00000000000000key = "value" bare_key = "value" bare-key = "value" 1234 = "value" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-30.json000066400000000000000000000003411513070226000306360ustar00rootroot00000000000000{ "ldt1": {"type": "datetime-local", "value": "1979-05-27T07:32:00"}, "ldt2": {"type": "datetime-local", "value": "1979-05-27T07:32:00.5"}, "ldt3": {"type": "datetime-local", "value": "1979-05-27T00:32:00.999"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-30.toml000066400000000000000000000001271513070226000306420ustar00rootroot00000000000000ldt1 = 1979-05-27T07:32:00 ldt2 = 1979-05-27T07:32:00.5 ldt3 = 1979-05-27T00:32:00.999 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-31.json000066400000000000000000000001131513070226000306340ustar00rootroot00000000000000{ "ldt3": {"type": "datetime-local", "value": "1979-05-27T07:32:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-31.toml000066400000000000000000000000301513070226000306340ustar00rootroot00000000000000ldt3 = 1979-05-27T07:32 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-32.json000066400000000000000000000000751513070226000306440ustar00rootroot00000000000000{ "ld1": {"type": "date-local", "value": "1979-05-27"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-32.toml000066400000000000000000000000211513070226000306350ustar00rootroot00000000000000ld1 = 1979-05-27 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-33.json000066400000000000000000000002611513070226000306420ustar00rootroot00000000000000{ "lt1": {"type": "time-local", "value": "07:32:00"}, "lt2": {"type": "time-local", "value": "00:32:00.5"}, "lt3": {"type": "time-local", "value": "00:32:00.999"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-33.toml000066400000000000000000000000631513070226000306440ustar00rootroot00000000000000lt1 = 07:32:00 lt2 = 00:32:00.5 lt3 = 00:32:00.999 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-34.json000066400000000000000000000000731513070226000306440ustar00rootroot00000000000000{ "lt3": {"type": "time-local", "value": "07:32:00"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-34.toml000066400000000000000000000000141513070226000306410ustar00rootroot00000000000000lt3 = 07:32 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-35.json000066400000000000000000000033511513070226000306470ustar00rootroot00000000000000{ "colors": [ {"type": "string", "value": "red"}, {"type": "string", "value": "yellow"}, {"type": "string", "value": "green"} ], "contributors": [ {"type": "string", "value": "Foo Bar \u003cfoo@example.com\u003e"}, { "email": {"type": "string", "value": "bazqux@example.com"}, "name": {"type": "string", "value": "Baz Qux"}, "url": {"type": "string", "value": "https://example.com/bazqux"} } ], "integers": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "nested_arrays_of_ints": [ [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ], [ {"type": "integer", "value": "3"}, {"type": "integer", "value": "4"}, {"type": "integer", "value": "5"} ] ], "nested_mixed_array": [ [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ], [ {"type": "string", "value": "a"}, {"type": "string", "value": "b"}, {"type": "string", "value": "c"} ] ], "numbers": [ {"type": "float", "value": "0.1"}, {"type": "float", "value": "0.2"}, {"type": "float", "value": "0.5"}, {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "5"} ], "string_array": [ {"type": "string", "value": "all"}, {"type": "string", "value": "strings"}, {"type": "string", "value": "are the same"}, {"type": "string", "value": "type"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-35.toml000066400000000000000000000006651513070226000306560ustar00rootroot00000000000000integers = [ 1, 2, 3 ] colors = [ "red", "yellow", "green" ] nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ] nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] string_array = [ "all", 'strings', """are the same""", '''type''' ] # Mixed-type arrays are allowed numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ] contributors = [ "Foo Bar ", { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-36.json000066400000000000000000000004141513070226000306450ustar00rootroot00000000000000{ "integers2": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"}, {"type": "integer", "value": "3"} ], "integers3": [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-36.toml000066400000000000000000000001021513070226000306410ustar00rootroot00000000000000integers2 = [ 1, 2, 3 ] integers3 = [ 1, 2, # this is ok ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-37.json000066400000000000000000000000241513070226000306430ustar00rootroot00000000000000{ "table": {} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-37.toml000066400000000000000000000000101513070226000306400ustar00rootroot00000000000000[table] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-38.json000066400000000000000000000004261513070226000306520ustar00rootroot00000000000000{ "table-1": { "key1": {"type": "string", "value": "some string"}, "key2": {"type": "integer", "value": "123"} }, "table-2": { "key1": {"type": "string", "value": "another string"}, "key2": {"type": "integer", "value": "456"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-38.toml000066400000000000000000000001301513070226000306440ustar00rootroot00000000000000[table-1] key1 = "some string" key2 = 123 [table-2] key1 = "another string" key2 = 456 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-39.json000066400000000000000000000002271513070226000306520ustar00rootroot00000000000000{ "dog": { "tater.man": { "type": { "name": {"type": "string", "value": "pug"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-39.toml000066400000000000000000000000441513070226000306510ustar00rootroot00000000000000[dog."tater.man"] type.name = "pug" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-4.json000066400000000000000000000005061513070226000305620ustar00rootroot00000000000000{ "127.0.0.1": {"type": "string", "value": "value"}, "character encoding": {"type": "string", "value": "value"}, "key2": {"type": "string", "value": "value"}, "quoted \"value\"": {"type": "string", "value": "value"}, "ʎǝʞ": {"type": "string", "value": "value"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-4.toml000066400000000000000000000001641513070226000305640ustar00rootroot00000000000000"127.0.0.1" = "value" "character encoding" = "value" "ʎǝʞ" = "value" 'key2' = "value" 'quoted "value"' = "value" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-40.json000066400000000000000000000004001513070226000306330ustar00rootroot00000000000000{ "a": { "b": { "c": {} } }, "d": { "e": { "f": {} } }, "g": { "h": { "i": {} } }, "j": { "ʞ": { "l": {} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-40.toml000066400000000000000000000002401513070226000306370ustar00rootroot00000000000000[a.b.c] # this is best practice [ d.e.f ] # same as [d.e.f] [ g . h . i ] # same as [g.h.i] [ j . "ʞ" . 'l' ] # same as [j."ʞ".'l'] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-41.json000066400000000000000000000001471513070226000306440ustar00rootroot00000000000000{ "x": { "y": { "z": { "w": {} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-41.toml000066400000000000000000000001701513070226000306420ustar00rootroot00000000000000# [x] you # [x.y] don't # [x.y.z] need these [x.y.z.w] # for this to work [x] # defining a super-table afterward is ok hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-42.json000066400000000000000000000001261513070226000306420ustar00rootroot00000000000000{ "animal": {}, "fruit": { "apple": {}, "orange": {} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-42.toml000066400000000000000000000000761513070226000306500ustar00rootroot00000000000000# VALID BUT DISCOURAGED [fruit.apple] [animal] [fruit.orange] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-43.json000066400000000000000000000001261513070226000306430ustar00rootroot00000000000000{ "animal": {}, "fruit": { "apple": {}, "orange": {} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-43.toml000066400000000000000000000000641513070226000306460ustar00rootroot00000000000000# RECOMMENDED [fruit.apple] [fruit.orange] [animal] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-44.json000066400000000000000000000004101513070226000306400ustar00rootroot00000000000000{ "breed": {"type": "string", "value": "pug"}, "name": {"type": "string", "value": "Fido"}, "owner": { "member_since": {"type": "date-local", "value": "1999-08-04"}, "name": {"type": "string", "value": "Regina Dogman"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-44.toml000066400000000000000000000002101513070226000306400ustar00rootroot00000000000000# Top-level table begins. name = "Fido" breed = "pug" # Top-level table ends. [owner] name = "Regina Dogman" member_since = 1999-08-04 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-45.json000066400000000000000000000003171513070226000306470ustar00rootroot00000000000000{ "fruit": { "apple": { "color": {"type": "string", "value": "red"}, "taste": { "sweet": {"type": "bool", "value": "true"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-45.toml000066400000000000000000000003231513070226000306460ustar00rootroot00000000000000fruit.apple.color = "red" # Defines a table named fruit # Defines a table named fruit.apple fruit.apple.taste.sweet = true # Defines a table named fruit.apple.taste # fruit and fruit.apple were already created hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-46.json000066400000000000000000000004631513070226000306520ustar00rootroot00000000000000{ "fruit": { "apple": { "color": {"type": "string", "value": "red"}, "taste": { "sweet": {"type": "bool", "value": "true"} }, "texture": { "smooth": {"type": "bool", "value": "true"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-46.toml000066400000000000000000000002611513070226000306500ustar00rootroot00000000000000[fruit] apple.color = "red" apple.taste.sweet = true # [fruit.apple] # INVALID # [fruit.apple.taste] # INVALID [fruit.apple.texture] # you can add sub-tables smooth = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-47.json000066400000000000000000000013261513070226000306520ustar00rootroot00000000000000{ "animal": { "type": { "name": {"type": "string", "value": "pug"} } }, "contact": { "personal": { "email": {"type": "string", "value": "donald@duckburg.com"}, "name": {"type": "string", "value": "Donald Duck"} }, "work": { "email": {"type": "string", "value": "donald@ScroogeCorp.com"}, "name": {"type": "string", "value": "Coin cleaner"} } }, "name": { "first": {"type": "string", "value": "Tom"}, "last": {"type": "string", "value": "Preston-Werner"} }, "point": { "x": {"type": "integer", "value": "1"}, "y": {"type": "integer", "value": "2"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-47.toml000066400000000000000000000004541513070226000306550ustar00rootroot00000000000000name = { first = "Tom", last = "Preston-Werner" } point = {x=1, y=2} animal = { type.name = "pug" } contact = { personal = { name = "Donald Duck", email = "donald@duckburg.com", }, work = { name = "Coin cleaner", email = "donald@ScroogeCorp.com", }, } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-48.json000066400000000000000000000013261513070226000306530ustar00rootroot00000000000000{ "animal": { "type": { "name": {"type": "string", "value": "pug"} } }, "contact": { "personal": { "email": {"type": "string", "value": "donald@duckburg.com"}, "name": {"type": "string", "value": "Donald Duck"} }, "work": { "email": {"type": "string", "value": "donald@ScroogeCorp.com"}, "name": {"type": "string", "value": "Coin cleaner"} } }, "name": { "first": {"type": "string", "value": "Tom"}, "last": {"type": "string", "value": "Preston-Werner"} }, "point": { "x": {"type": "integer", "value": "1"}, "y": {"type": "integer", "value": "2"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-48.toml000066400000000000000000000003541513070226000306550ustar00rootroot00000000000000[name] first = "Tom" last = "Preston-Werner" [point] x = 1 y = 2 [animal] type.name = "pug" [contact.personal] name = "Donald Duck" email = "donald@duckburg.com" [contact.work] name = "Coin cleaner" email = "donald@ScroogeCorp.com" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-49.json000066400000000000000000000001571513070226000306550ustar00rootroot00000000000000{ "product": { "type": { "name": {"type": "string", "value": "Nail"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-49.toml000066400000000000000000000001041513070226000306470ustar00rootroot00000000000000[product] type = { name = "Nail" } # type.edible = false # INVALID hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-50.json000066400000000000000000000001571513070226000306450ustar00rootroot00000000000000{ "product": { "type": { "name": {"type": "string", "value": "Nail"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-50.toml000066400000000000000000000001041513070226000306370ustar00rootroot00000000000000[product] type.name = "Nail" # type = { edible = false } # INVALID hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-51.json000066400000000000000000000005741513070226000306510ustar00rootroot00000000000000{ "product": [ { "name": {"type": "string", "value": "Hammer"}, "sku": {"type": "integer", "value": "738594937"} }, {}, { "color": {"type": "string", "value": "gray"}, "name": {"type": "string", "value": "Nail"}, "sku": {"type": "integer", "value": "284758393"} } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-51.toml000066400000000000000000000002241513070226000306430ustar00rootroot00000000000000[[product]] name = "Hammer" sku = 738594937 [[product]] # empty table within the array [[product]] name = "Nail" sku = 284758393 color = "gray" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-52.json000066400000000000000000000013171513070226000306460ustar00rootroot00000000000000{ "fruits": [ { "name": {"type": "string", "value": "apple"}, "physical": { "color": {"type": "string", "value": "red"}, "shape": {"type": "string", "value": "round"} }, "varieties": [ { "name": {"type": "string", "value": "red delicious"} }, { "name": {"type": "string", "value": "granny smith"} } ] }, { "name": {"type": "string", "value": "banana"}, "varieties": [{ "name": {"type": "string", "value": "plantain"} }] } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-52.toml000066400000000000000000000004171513070226000306500ustar00rootroot00000000000000[[fruits]] name = "apple" [fruits.physical] # subtable color = "red" shape = "round" [[fruits.varieties]] # nested array of tables name = "red delicious" [[fruits.varieties]] name = "granny smith" [[fruits]] name = "banana" [[fruits.varieties]] name = "plantain" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-53.json000066400000000000000000000010511513070226000306420ustar00rootroot00000000000000{ "points": [ { "x": {"type": "integer", "value": "1"}, "y": {"type": "integer", "value": "2"}, "z": {"type": "integer", "value": "3"} }, { "x": {"type": "integer", "value": "7"}, "y": {"type": "integer", "value": "8"}, "z": {"type": "integer", "value": "9"} }, { "x": {"type": "integer", "value": "2"}, "y": {"type": "integer", "value": "4"}, "z": {"type": "integer", "value": "8"} } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-53.toml000066400000000000000000000001551513070226000306500ustar00rootroot00000000000000points = [ { x = 1, y = 2, z = 3 }, { x = 7, y = 8, z = 9 }, { x = 2, y = 4, z = 8 } ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-6.json000066400000000000000000000004121513070226000305600ustar00rootroot00000000000000{ "name": {"type": "string", "value": "Orange"}, "physical": { "color": {"type": "string", "value": "orange"}, "shape": {"type": "string", "value": "round"} }, "site": { "google.com": {"type": "bool", "value": "true"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-6.toml000066400000000000000000000001341513070226000305630ustar00rootroot00000000000000name = "Orange" physical.color = "orange" physical.shape = "round" site."google.com" = true hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-7.json000066400000000000000000000003031513070226000305600ustar00rootroot00000000000000{ "fruit": { "color": {"type": "string", "value": "yellow"}, "flavor": {"type": "string", "value": "banana"}, "name": {"type": "string", "value": "banana"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-7.toml000066400000000000000000000002311513070226000305620ustar00rootroot00000000000000fruit.name = "banana" # this is best practice fruit. color = "yellow" # same as fruit.color fruit . flavor = "banana" # same as fruit.flavor hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-8.json000066400000000000000000000002431513070226000305640ustar00rootroot00000000000000{ "fruit": { "orange": {"type": "integer", "value": "2"}, "apple": { "smooth": {"type": "bool", "value": "true"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-8.toml000066400000000000000000000002131513070226000305630ustar00rootroot00000000000000# This makes the key "fruit" into a table. fruit.apple.smooth = true # So then you can add to the table "fruit" like so: fruit.orange = 2 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-9.json000066400000000000000000000005661513070226000305750ustar00rootroot00000000000000{ "apple": { "color": {"type": "string", "value": "red"}, "skin": {"type": "string", "value": "thin"}, "type": {"type": "string", "value": "fruit"} }, "orange": { "color": {"type": "string", "value": "orange"}, "skin": {"type": "string", "value": "thick"}, "type": {"type": "string", "value": "fruit"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-1.1.0/common-9.toml000066400000000000000000000002341513070226000305670ustar00rootroot00000000000000# VALID BUT DISCOURAGED apple.type = "fruit" orange.type = "fruit" apple.skin = "thin" orange.skin = "thick" apple.color = "red" orange.color = "orange" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-example-1-compact.json000066400000000000000000000025411513070226000317120ustar00rootroot00000000000000{ "title": {"type": "string", "value": "TOML Example"}, "clients": { "data": [ [ {"type": "string", "value": "gamma"}, {"type": "string", "value": "delta"} ], [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ] ], "hosts": [ {"type": "string", "value": "alpha"}, {"type": "string", "value": "omega"} ] }, "database": { "connection_max": {"type": "integer", "value": "5000"}, "enabled": {"type": "bool", "value": "true"}, "server": {"type": "string", "value": "192.168.1.1"}, "ports": [ {"type": "integer", "value": "8001"}, {"type": "integer", "value": "8001"}, {"type": "integer", "value": "8002"} ] }, "owner": { "dob": {"type": "datetime", "value": "1979-05-27T07:32:00-08:00"}, "name": {"type": "string", "value": "Lance Uppercut"} }, "servers": { "alpha": { "dc": {"type": "string", "value": "eqdc10"}, "ip": {"type": "string", "value": "10.0.0.1"} }, "beta": { "dc": {"type": "string", "value": "eqdc10"}, "ip": {"type": "string", "value": "10.0.0.2"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-example-1-compact.toml000066400000000000000000000005701513070226000317140ustar00rootroot00000000000000#Useless spaces eliminated. title="TOML Example" [owner] name="Lance Uppercut" dob=1979-05-27T07:32:00-08:00#First class dates [database] server="192.168.1.1" ports=[8001,8001,8002] connection_max=5000 enabled=true [servers] [servers.alpha] ip="10.0.0.1" dc="eqdc10" [servers.beta] ip="10.0.0.2" dc="eqdc10" [clients] data=[["gamma","delta"],[1,2]] hosts=[ "alpha", "omega" ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-example-1.json000066400000000000000000000025411513070226000302660ustar00rootroot00000000000000{ "title": {"type": "string", "value": "TOML Example"}, "clients": { "data": [ [ {"type": "string", "value": "gamma"}, {"type": "string", "value": "delta"} ], [ {"type": "integer", "value": "1"}, {"type": "integer", "value": "2"} ] ], "hosts": [ {"type": "string", "value": "alpha"}, {"type": "string", "value": "omega"} ] }, "database": { "connection_max": {"type": "integer", "value": "5000"}, "enabled": {"type": "bool", "value": "true"}, "server": {"type": "string", "value": "192.168.1.1"}, "ports": [ {"type": "integer", "value": "8001"}, {"type": "integer", "value": "8001"}, {"type": "integer", "value": "8002"} ] }, "owner": { "dob": {"type": "datetime", "value": "1979-05-27T07:32:00-08:00"}, "name": {"type": "string", "value": "Lance Uppercut"} }, "servers": { "alpha": { "dc": {"type": "string", "value": "eqdc10"}, "ip": {"type": "string", "value": "10.0.0.1"} }, "beta": { "dc": {"type": "string", "value": "eqdc10"}, "ip": {"type": "string", "value": "10.0.0.2"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/spec-example-1.toml000066400000000000000000000010571513070226000302710ustar00rootroot00000000000000# This is a TOML document. Boom. title = "TOML Example" [owner] name = "Lance Uppercut" dob = 1979-05-27T07:32:00-08:00 # First class dates? Why not? [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # You can indent as you please. Tabs or spaces. TOML don't care. [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/000077500000000000000000000000001513070226000261565ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-01.json000066400000000000000000000000671513070226000316110ustar00rootroot00000000000000{ "test": {"type": "string", "value": "\"one\""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-01.toml000066400000000000000000000000341513070226000316050ustar00rootroot00000000000000# Escape " test = "\"one\"" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-02.json000066400000000000000000000000671513070226000316120ustar00rootroot00000000000000{ "test": {"type": "string", "value": "\\\"one"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-02.toml000066400000000000000000000000471513070226000316120ustar00rootroot00000000000000# Escape \ and then " test = "\\\"one" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-03.json000066400000000000000000000000751513070226000316120ustar00rootroot00000000000000{ "test": {"type": "string", "value": "\\\\\\\\\"one"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/basic-escape-03.toml000066400000000000000000000000701513070226000316070ustar00rootroot00000000000000# Escape \ four times and then " test = "\\\\\\\\\"one" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/empty.json000066400000000000000000000000621513070226000302050ustar00rootroot00000000000000{ "answer": {"type": "string", "value": ""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/empty.toml000066400000000000000000000000141513070226000302040ustar00rootroot00000000000000answer = "" ends-in-whitespace-escape.json000066400000000000000000000000741513070226000337200ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string{ "beee": {"type": "string", "value": "heeee\ngeeee"} } ends-in-whitespace-escape.toml000066400000000000000000000000461513070226000337210ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/stringbeee = """ heeee geeee\ """ hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escape-esc.json000066400000000000000000000001201513070226000310520ustar00rootroot00000000000000{ "esc": {"type": "string", "value": "\u001b There is no escape! \u001b"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escape-esc.toml000066400000000000000000000000421513070226000310570ustar00rootroot00000000000000esc = "\e There is no escape! \e" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escape-tricky.json000066400000000000000000000011431513070226000316130ustar00rootroot00000000000000{ "end_esc": {"type": "string", "value": "String does not end here\" but ends here\\"}, "lit_end_esc": {"type": "string", "value": "String ends here\\"}, "lit_multiline_end": {"type": "string", "value": "There is no escape\\"}, "lit_multiline_not_unicode": {"type": "string", "value": "\\u007f"}, "multiline_end_esc": {"type": "string", "value": "When will it end? \"\"\"...\"\"\" should be here\""}, "multiline_not_unicode": {"type": "string", "value": "\\u0041"}, "multiline_unicode": {"type": "string", "value": " "} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escape-tricky.toml000066400000000000000000000005101513070226000316120ustar00rootroot00000000000000end_esc = "String does not end here\" but ends here\\" lit_end_esc = 'String ends here\' multiline_unicode = """ \u00a0""" multiline_not_unicode = """ \\u0041""" multiline_end_esc = """When will it end? \"""...""\" should be here\"""" lit_multiline_not_unicode = ''' \u007f''' lit_multiline_end = '''There is no escape\''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escaped-escape.json000066400000000000000000000000671513070226000317160ustar00rootroot00000000000000{ "answer": {"type": "string", "value": "\\x64"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escaped-escape.toml000066400000000000000000000000211513070226000317060ustar00rootroot00000000000000answer = "\\x64" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escapes.json000066400000000000000000000014001513070226000304670ustar00rootroot00000000000000{ "backslash": {"type": "string", "value": "|\\."}, "backspace": {"type": "string", "value": "|\b."}, "carriage": {"type": "string", "value": "|\r."}, "delete": {"type": "string", "value": "|."}, "formfeed": {"type": "string", "value": "|\f."}, "newline": {"type": "string", "value": "|\n."}, "notunicode1": {"type": "string", "value": "|\\u."}, "notunicode2": {"type": "string", "value": "|\\u."}, "notunicode3": {"type": "string", "value": "|\\u0075."}, "notunicode4": {"type": "string", "value": "|\\u."}, "quote": {"type": "string", "value": "|\"."}, "tab": {"type": "string", "value": "|\t."}, "unitseparator": {"type": "string", "value": "|\u001f."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/escapes.toml000066400000000000000000000006031513070226000304750ustar00rootroot00000000000000backspace = "|\b." tab = "|\t." newline = "|\n." formfeed = "|\f." carriage = "|\r." quote = "|\"." backslash = "|\\." delete = "|\u007F." unitseparator = "|\u001F." # \u is escaped, so should NOT be interperted as a \u escape. notunicode1 = "|\\u." notunicode2 = "|\u005Cu." notunicode3 = "|\\u0075." notunicode4 = "|\\\u0075." hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/hex-escape.json000066400000000000000000000011411513070226000310700ustar00rootroot00000000000000{ "bs": {"type": "string", "value": ""}, "hello": {"type": "string", "value": "hello\n"}, "higher-than-127": {"type": "string", "value": "Sørmirbæren"}, "literal": {"type": "string", "value": "\\x20 \\x09 \\x0d\\x0a"}, "multiline": {"type": "string", "value": " \t \u001b \r\n\n\n\u0000\nhello\n\nSørmirbæren\n"}, "multiline-literal": {"type": "string", "value": "\\x20 \\x09 \\x0d\\x0a\n"}, "nul": {"type": "string", "value": "\u0000"}, "whitespace": {"type": "string", "value": " \t \u001b \r\n"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/hex-escape.toml000066400000000000000000000006671513070226000311060ustar00rootroot00000000000000# \x for the first 255 codepoints whitespace = "\x20 \x09 \x1b \x0d\x0a" bs = "\x7f" nul = "\x00" hello = "\x68\x65\x6c\x6c\x6f\x0a" higher-than-127 = "S\xf8rmirb\xe6ren" multiline = """ \x20 \x09 \x1b \x0d\x0a \x7f \x00 \x68\x65\x6c\x6c\x6f\x0a \x53\xF8\x72\x6D\x69\x72\x62\xE6\x72\x65\x6E """ # Not inside literals. literal = '\x20 \x09 \x0d\x0a' multiline-literal = ''' \x20 \x09 \x0d\x0a ''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multibyte-escape.json000066400000000000000000000004431513070226000323260ustar00rootroot00000000000000{ "basic-1": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "ml-basic-1": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "basic-2": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "ml-basic-2": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multibyte-escape.toml000066400000000000000000000006001513070226000323230ustar00rootroot00000000000000# Test each multibyte length: 2, 3, and 4 bytes: # ɑ € 𐫱 basic-1 = "\u0251 \u20ac \U00010AF1 \u0251\u20ac\U00010AF1" ml-basic-1 = """\u0251 \u20ac \U00010AF1 \u0251\u20ac\U00010AF1""" # Again, but only using \U basic-2 = "\U00000251 \U000020ac \U00010AF1 \U00000251\U000020ac\U00010AF1" ml-basic-2 = """\U00000251 \U000020ac \U00010AF1 \U00000251\U000020ac\U00010AF1""" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multibyte.json000066400000000000000000000004331513070226000310670ustar00rootroot00000000000000{ "basic": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "ml-basic": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "ml-raw": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"}, "raw": {"type": "string", "value": "ɑ € 𐫱 ɑ€𐫱"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multibyte.toml000066400000000000000000000003241513070226000310700ustar00rootroot00000000000000# Test each multibyte length: 2, 3, and 4 bytes: # ɑ € 𐫱 basic = "ɑ € 𐫱 ɑ€𐫱" raw = 'ɑ € 𐫱 ɑ€𐫱' ml-basic = """ɑ € 𐫱 ɑ€𐫱""" ml-raw = '''ɑ € 𐫱 ɑ€𐫱''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-empty.json000066400000000000000000000003031513070226000322030ustar00rootroot00000000000000{ "empty-1": {"type": "string", "value": ""}, "empty-2": {"type": "string", "value": ""}, "empty-3": {"type": "string", "value": ""}, "empty-4": {"type": "string", "value": ""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-empty.toml000066400000000000000000000004301513070226000322060ustar00rootroot00000000000000empty-1 = """""" # A newline immediately following the opening delimiter will be trimmed. empty-2 = """ """ # \ at the end of line trims newlines as well; note that last \ is followed by # two spaces, which are ignored. empty-3 = """\ """ empty-4 = """\ \ \ """ hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-escaped-crlf.json000066400000000000000000000000551513070226000334010ustar00rootroot00000000000000{ "0": {"type": "string", "value": ""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-escaped-crlf.toml000066400000000000000000000001671513070226000334070ustar00rootroot00000000000000# The following line should be an unescaped backslash followed by a Windows # newline sequence ("\r\n") 0="""\ """ hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-quotes.json000066400000000000000000000016211513070226000323710ustar00rootroot00000000000000{ "escaped": {"type": "string", "value": "lol\"\"\""}, "five-quotes": {"type": "string", "value": "Closing with five quotes\n\"\""}, "four-quotes": {"type": "string", "value": "Closing with four quotes\n\""}, "lit_one": {"type": "string", "value": "'one quote'"}, "lit_one_space": {"type": "string", "value": " 'one quote' "}, "lit_two": {"type": "string", "value": "''two quotes''"}, "lit_two_space": {"type": "string", "value": " ''two quotes'' "}, "mismatch1": {"type": "string", "value": "aaa'''bbb"}, "mismatch2": {"type": "string", "value": "aaa\"\"\"bbb"}, "one": {"type": "string", "value": "\"one quote\""}, "one_space": {"type": "string", "value": " \"one quote\" "}, "two": {"type": "string", "value": "\"\"two quotes\"\""}, "two_space": {"type": "string", "value": " \"\"two quotes\"\" "} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline-quotes.toml000066400000000000000000000012301513070226000323670ustar00rootroot00000000000000# Make sure that quotes inside multiline strings are allowed, including right # after the opening '''/""" and before the closing '''/""" lit_one = ''''one quote'''' lit_two = '''''two quotes''''' lit_one_space = ''' 'one quote' ''' lit_two_space = ''' ''two quotes'' ''' one = """"one quote"""" two = """""two quotes""""" one_space = """ "one quote" """ two_space = """ ""two quotes"" """ mismatch1 = """aaa'''bbb""" mismatch2 = '''aaa"""bbb''' # Three opening """, then one escaped ", then two "" (allowed), and then three # closing """ escaped = """lol\"""""" five-quotes = """ Closing with five quotes """"" four-quotes = """ Closing with four quotes """" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline.json000066400000000000000000000013571513070226000310610ustar00rootroot00000000000000{ "equivalent_one": {"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."}, "equivalent_two": {"type": "string", "value": "The quick brown fox jumps over the lazy dog."}, "escape-bs-1": {"type": "string", "value": "a \\\nb"}, "escape-bs-2": {"type": "string", "value": "a \\b"}, "escape-bs-3": {"type": "string", "value": "a \\\\\n b"}, "keep-ws-before": {"type": "string", "value": "a \tb"}, "no-space": {"type": "string", "value": "ab"}, "whitespace-after-bs": {"type": "string", "value": "The quick brown fox jumps over the lazy dog."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/multiline.toml000066400000000000000000000011241513070226000310530ustar00rootroot00000000000000# NOTE: this file includes some literal tab characters. 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.\ """ whitespace-after-bs = """\ The quick brown \ fox jumps over \ the lazy dog.\ """ no-space = """a\ b""" # Has tab character. keep-ws-before = """a \ b""" escape-bs-1 = """a \\ b""" escape-bs-2 = """a \\\ b""" escape-bs-3 = """a \\\\ b""" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/nl.json000066400000000000000000000004471513070226000274670ustar00rootroot00000000000000{ "lit_nl_end": {"type": "string", "value": "value\\n"}, "lit_nl_mid": {"type": "string", "value": "val\\nue"}, "lit_nl_uni": {"type": "string", "value": "val\\ue"}, "nl_end": {"type": "string", "value": "value\n"}, "nl_mid": {"type": "string", "value": "val\nue"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/nl.toml000066400000000000000000000001631513070226000274640ustar00rootroot00000000000000nl_mid = "val\nue" nl_end = """value\n""" lit_nl_end = '''value\n''' lit_nl_mid = 'val\nue' lit_nl_uni = 'val\ue' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/quoted-unicode.json000066400000000000000000000007131513070226000317770ustar00rootroot00000000000000{ "basic_string": {"type": "string", "value": "~ € ÿ ퟿  ￿ 𐀀 􏿿"}, "escaped_string": {"type": "string", "value": "\u0000 \b \f A  € ÿ ퟿  ￿ 𐀀 􏿿"}, "literal_string": {"type": "string", "value": "~ € ÿ ퟿  ￿ 𐀀 􏿿"}, "not_escaped_string": { "type": "string", "value": "\\u0000 \\u0008 \\u000c \\U00000041 \\u007f \\u0080 \\u00ff \\ud7ff \\ue000 \\uffff \\U00010000 \\U0010ffff" } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/quoted-unicode.toml000066400000000000000000000005141513070226000320000ustar00rootroot00000000000000 escaped_string = "\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff" not_escaped_string = '\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff' basic_string = "~ € ÿ ퟿  ￿ 𐀀 􏿿" literal_string = '~ € ÿ ퟿  ￿ 𐀀 􏿿' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw-empty.json000066400000000000000000000000611513070226000307730ustar00rootroot00000000000000{ "empty": {"type": "string", "value": ""} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw-empty.toml000066400000000000000000000000131513070226000307720ustar00rootroot00000000000000empty = '' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw-multiline.json000066400000000000000000000010361513070226000316420ustar00rootroot00000000000000{ "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."}, "multiline_with_tab": {"type": "string", "value": "First line\n\t Followed by a tab"}, "oneline": {"type": "string", "value": "This string has a ' quote character."}, "this-str-has-apostrophes": {"type": "string", "value": "' there's one already\n'' two more\n''"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw-multiline.toml000066400000000000000000000010471513070226000316460ustar00rootroot00000000000000# Single ' should be allowed. oneline = '''This string has a ' quote character.''' # A newline immediately following the opening delimiter will be trimmed. firstnl = ''' This string has a ' quote character.''' # All other whitespace and newline characters remain intact. multiline = ''' This string has ' a quote character and more than one newline in it.''' # Tab character in literal string does not need to be escaped multiline_with_tab = '''First line Followed by a tab''' this-str-has-apostrophes='''' there's one already '' two more ''''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw.json000066400000000000000000000014031513070226000276400ustar00rootroot00000000000000{ "backslash": {"type": "string", "value": "This string has a \\\\ backslash character."}, "backspace": {"type": "string", "value": "This string has a \\b backspace character."}, "carriage": {"type": "string", "value": "This string has a \\r carriage return character."}, "formfeed": {"type": "string", "value": "This string has a \\f form feed character."}, "newline": {"type": "string", "value": "This string has a \\n new line character."}, "slash": {"type": "string", "value": "This string has a \\/ slash character."}, "tab": {"type": "string", "value": "This string has a \\t tab character."}, "unescaped_tab": {"type": "string", "value": "This string has an \t unescaped tab character."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/raw.toml000066400000000000000000000006651513070226000276530ustar00rootroot00000000000000backspace = 'This string has a \b backspace character.' tab = 'This string has a \t tab character.' unescaped_tab = 'This string has an unescaped 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.' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/simple.json000066400000000000000000000001251513070226000303400ustar00rootroot00000000000000{ "answer": {"type": "string", "value": "You are not drinking enough whisky."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/simple.toml000066400000000000000000000000571513070226000303460ustar00rootroot00000000000000answer = "You are not drinking enough whisky." hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/start-mb.json000066400000000000000000000004761513070226000306110ustar00rootroot00000000000000{ "s1": {"type": "string", "value": "§"}, "s2": {"type": "string", "value": "§"}, "s3": {"type": "string", "value": "§"}, "s4": {"type": "string", "value": "§"}, "s5": {"type": "string", "value": "§"}, "s6": {"type": "string", "value": "§"}, "s7": {"type": "string", "value": "§"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/start-mb.toml000066400000000000000000000003031513070226000306000ustar00rootroot00000000000000# Start first line with a multibyte character. # # https://github.com/marzer/tomlplusplus/issues/190 s1 = "§" s2 = '§' s3 = """\ §""" s4 = """ §""" s5 = """§""" s6 = ''' §''' s7 = '''§''' hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/unicode-escape.json000066400000000000000000000013631513070226000317400ustar00rootroot00000000000000{ "a": {"type": "string", "value": "a"}, "b": {"type": "string", "value": "b"}, "c": {"type": "string", "value": "c"}, "delta-1": {"type": "string", "value": "δ"}, "delta-2": {"type": "string", "value": "δ"}, "ml-a": {"type": "string", "value": "a"}, "ml-b": {"type": "string", "value": "b"}, "ml-c": {"type": "string", "value": "c"}, "ml-delta-1": {"type": "string", "value": "δ"}, "ml-delta-2": {"type": "string", "value": "δ"}, "ml-null-1": {"type": "string", "value": "\u0000"}, "ml-null-2": {"type": "string", "value": "\u0000"}, "null-1": {"type": "string", "value": "\u0000"}, "null-2": {"type": "string", "value": "\u0000"} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/unicode-escape.toml000066400000000000000000000005241513070226000317400ustar00rootroot00000000000000delta-1 = "\u03B4" delta-2 = "\U000003B4" a = "\u0061" b = "\u0062" c = "\U00000063" null-1 = "\u0000" null-2 = "\U00000000" ml-delta-1 = """\u03B4""" ml-delta-2 = """\U000003B4""" ml-a = """\u0061""" ml-b = """\u0062""" ml-c = """\U00000063""" ml-null-1 = """\u0000""" ml-null-2 = """\U00000000""" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/with-pound.json000066400000000000000000000002521513070226000311460ustar00rootroot00000000000000{ "pound": {"type": "string", "value": "We see no # comments here."}, "poundcomment": {"type": "string", "value": "But there are # some comments here."} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/string/with-pound.toml000066400000000000000000000001611513070226000311470ustar00rootroot00000000000000pound = "We see no # comments here." poundcomment = "But there are # some comments here." # Did I # mess you up? hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/000077500000000000000000000000001513070226000257375ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-empty-name.json000066400000000000000000000001671513070226000320260ustar00rootroot00000000000000{ "": [ {"a": {"type": "integer", "value": "1"}}, {"a": {"type": "integer", "value": "2"}} ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-empty-name.toml000066400000000000000000000000731513070226000320240ustar00rootroot00000000000000# Silly thing to do, but valid. [['']] a = 1 [['']] a = 2 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-empty.json000066400000000000000000000000221513070226000310760ustar00rootroot00000000000000{ "a": [{}] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-empty.toml000066400000000000000000000000061513070226000311020ustar00rootroot00000000000000[[a]] array-implicit-and-explicit-after.json000066400000000000000000000002231513070226000351540ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table{ "a": { "b": [{ "x": {"type": "integer", "value": "1"} }], "y": {"type": "integer", "value": "2"} } } array-implicit-and-explicit-after.toml000066400000000000000000000000311513070226000351530ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table[[a.b]] x = 1 [a] y = 2 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-implicit.json000066400000000000000000000001411513070226000315540ustar00rootroot00000000000000{ "albums": {"songs": [{ "name": {"type": "string", "value": "Glory Days"} }]} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-implicit.toml000066400000000000000000000000451513070226000315610ustar00rootroot00000000000000[[albums.songs]] name = "Glory Days" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-many.json000066400000000000000000000007321513070226000307140ustar00rootroot00000000000000{ "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"} } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-many.toml000066400000000000000000000002431513070226000307130ustar00rootroot00000000000000[[people]] first_name = "Bruce" last_name = "Springsteen" [[people]] first_name = "Eric" last_name = "Clapton" [[people]] first_name = "Bob" last_name = "Seger" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-nest.json000066400000000000000000000013221513070226000307150ustar00rootroot00000000000000{ "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"} } ] } ] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-nest.toml000066400000000000000000000004061513070226000307210ustar00rootroot00000000000000[[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" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-one.json000066400000000000000000000002311513070226000305230ustar00rootroot00000000000000{ "people": [{ "first_name": {"type": "string", "value": "Bruce"}, "last_name": {"type": "string", "value": "Springsteen"} }] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-one.toml000066400000000000000000000000721513070226000305300ustar00rootroot00000000000000[[people]] first_name = "Bruce" last_name = "Springsteen" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-table-array.json000066400000000000000000000004651513070226000321560ustar00rootroot00000000000000{ "a": [{ "b": [ { "c": { "d": {"type": "string", "value": "val0"} } }, { "c": { "d": {"type": "string", "value": "val1"} } } ] }] } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-table-array.toml000066400000000000000000000001541513070226000321530ustar00rootroot00000000000000[[a]] [[a.b]] [a.b.c] d = "val0" [[a.b]] [a.b.c] d = "val1" hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-within-dotted.json000066400000000000000000000003201513070226000325240ustar00rootroot00000000000000{ "fruit": { "apple": { "color": {"type": "string", "value": "red"}, "seeds": [{ "size": {"type": "integer", "value": "2"} }] } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/array-within-dotted.toml000066400000000000000000000000741513070226000325340ustar00rootroot00000000000000[fruit] apple.color = "red" [[fruit.apple.seeds]] size = 2 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/empty-name.json000066400000000000000000000003551513070226000307110ustar00rootroot00000000000000{ "": { "x": {"type": "integer", "value": "1"}, "a": { "x": {"type": "integer", "value": "2"} } }, "a": { "": { "x": {"type": "integer", "value": "3"} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/empty-name.toml000066400000000000000000000000471513070226000307110ustar00rootroot00000000000000[''] x = 1 ["".a] x = 2 [a.''] x = 3 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/empty.json000066400000000000000000000000201513070226000277600ustar00rootroot00000000000000{ "a": {} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/empty.toml000066400000000000000000000000041513070226000277640ustar00rootroot00000000000000[a] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/keyword-with-values.json000066400000000000000000000004221513070226000325620ustar00rootroot00000000000000{ "false": { "k": {"type": "integer", "value": "2"} }, "inf": { "k": {"type": "integer", "value": "3"} }, "nan": { "k": {"type": "integer", "value": "4"} }, "true": { "k": {"type": "integer", "value": "1"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/keyword-with-values.toml000066400000000000000000000000661513070226000325700ustar00rootroot00000000000000[true] k = 1 [false] k = 2 [inf] k = 3 [nan] k = 4 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/keyword.json000066400000000000000000000001071513070226000303140ustar00rootroot00000000000000{ "false": {}, "inf": {}, "nan": {}, "true": {} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/keyword.toml000066400000000000000000000000401513070226000303120ustar00rootroot00000000000000[true] [false] [inf] [nan] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/names-with-values.json000066400000000000000000000016201513070226000322020ustar00rootroot00000000000000{ "a": { " x ": { "key": {"type": "integer", "value": "4"} }, "b": { "c": { "key": {"type": "integer", "value": "1"} } }, "b.c": { "key": {"type": "integer", "value": "2"} }, "d.e": { "key": {"type": "integer", "value": "3"} } }, "d": { "e": { "f": { "key": {"type": "integer", "value": "5"} } } }, "g": { "h": { "i": { "key": {"type": "integer", "value": "6"} } } }, "j": { "ʞ": { "l": { "key": {"type": "integer", "value": "7"} } } }, "x": { "1": { "2": { "key": {"type": "integer", "value": "8"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/names-with-values.toml000066400000000000000000000002401513070226000322010ustar00rootroot00000000000000[a.b.c] key = 1 [a."b.c"] key = 2 [a.'d.e'] key = 3 [a.' x '] key = 4 [ d.e.f ] key = 5 [ g . h . i ] key = 6 [ j . "ʞ" . 'l' ] key = 7 [x.1.2] key = 8 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/names.json000066400000000000000000000005701513070226000277370ustar00rootroot00000000000000{ "a": { " x ": {}, "b.c": {}, "d.e": {}, "b": { "c": {} } }, "d": { "e": { "f": {} } }, "g": { "h": { "i": {} } }, "j": { "ʞ": { "l": {} } }, "x": { "1": { "2": {} } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/names.toml000066400000000000000000000001321513070226000277330ustar00rootroot00000000000000[a.b.c] [a."b.c"] [a.'d.e'] [a.' x '] [ d.e.f ] [ g . h . i ] [ j . "ʞ" . 'l' ] [x.1.2] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/no-eol.json000066400000000000000000000000241513070226000300170ustar00rootroot00000000000000{ "table": {} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/no-eol.toml000066400000000000000000000000101513070226000300140ustar00rootroot00000000000000[table] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/sub-empty.json000066400000000000000000000000451513070226000305560ustar00rootroot00000000000000{ "a": { "b": {} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/sub-empty.toml000066400000000000000000000000121513070226000305520ustar00rootroot00000000000000[a] [a.b] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/sub.json000066400000000000000000000003701513070226000274230ustar00rootroot00000000000000{ "a": { "key": {"type": "integer", "value": "1"}, "extend": { "key": {"type": "integer", "value": "2"}, "more": { "key": {"type": "integer", "value": "3"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/sub.toml000066400000000000000000000001431513070226000274230ustar00rootroot00000000000000[a] key = 1 # a.extend is a key inside the "a" table. [a.extend] key = 2 [a.extend.more] key = 3 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/whitespace.json000066400000000000000000000000301513070226000307570ustar00rootroot00000000000000{ "valid key": {} } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/whitespace.toml000066400000000000000000000000161513070226000307650ustar00rootroot00000000000000["valid key"] hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-literal-string.json000066400000000000000000000002201513070226000325350ustar00rootroot00000000000000{ "a": { "\"b\"": { "c": { "answer": {"type": "integer", "value": "42"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-literal-string.toml000066400000000000000000000000511513070226000325410ustar00rootroot00000000000000['a'] [a.'"b"'] [a.'"b"'.c] answer = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-pound.json000066400000000000000000000001221513070226000307230ustar00rootroot00000000000000{ "key#group": { "answer": {"type": "integer", "value": "42"} } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-pound.toml000066400000000000000000000000321513070226000307250ustar00rootroot00000000000000["key#group"] answer = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-single-quotes.json000066400000000000000000000002141513070226000323770ustar00rootroot00000000000000{ "a": { "b": { "c": { "answer": {"type": "integer", "value": "42"} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/with-single-quotes.toml000066400000000000000000000000451513070226000324030ustar00rootroot00000000000000['a'] [a.'b'] [a.'b'.c] answer = 42 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/without-super-with-values.json000066400000000000000000000005171513070226000337420ustar00rootroot00000000000000{ "x": { "c": {"type": "integer", "value": "3"}, "d": {"type": "integer", "value": "4"}, "y": { "z": { "w": { "a": {"type": "integer", "value": "1"}, "b": {"type": "integer", "value": "2"} } } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/without-super-with-values.toml000066400000000000000000000002201513070226000337330ustar00rootroot00000000000000# [x] you # [x.y] don't # [x.y.z] need these [x.y.z.w] # for this to work a = 1 b = 2 [x] # defining a super-table afterwards is ok c = 3 d = 4 hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/without-super.json000066400000000000000000000001471513070226000314730ustar00rootroot00000000000000{ "x": { "y": { "z": { "w": {} } } } } hukkin-tomli-7940ff4/tests/data/valid/_external/toml-test/valid/table/without-super.toml000066400000000000000000000001701513070226000314710ustar00rootroot00000000000000# [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 hukkin-tomli-7940ff4/tests/data/valid/apostrophes-in-literal-string.json000066400000000000000000000001441513070226000264430ustar00rootroot00000000000000{"this-str-has-apostrophes": {"type": "string", "value": "' there's one already\n'' two more\n''"}} hukkin-tomli-7940ff4/tests/data/valid/apostrophes-in-literal-string.toml000066400000000000000000000001041513070226000264410ustar00rootroot00000000000000this-str-has-apostrophes='''' there's one already '' two more ''''' hukkin-tomli-7940ff4/tests/data/valid/array/000077500000000000000000000000001513070226000207565ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/array/array-subtables.json000066400000000000000000000003021513070226000247440ustar00rootroot00000000000000{"arr": {"type":"array","value": [ {"subtab": {"val": {"type":"integer","value":"1"} } }, {"subtab": {"val": {"type":"integer","value":"2"}}} ] } } hukkin-tomli-7940ff4/tests/data/valid/array/array-subtables.toml000066400000000000000000000000671513070226000247560ustar00rootroot00000000000000[[arr]] [arr.subtab] val=1 [[arr]] [arr.subtab] val=2 hukkin-tomli-7940ff4/tests/data/valid/array/open-parent-table.json000066400000000000000000000001671513070226000251720ustar00rootroot00000000000000{ "parent-table": { "arr": {"type":"array","value":[{},{}]}, "not-arr": {"type":"integer","value":"1"} } } hukkin-tomli-7940ff4/tests/data/valid/array/open-parent-table.toml000066400000000000000000000001051513070226000251640ustar00rootroot00000000000000[[parent-table.arr]] [[parent-table.arr]] [parent-table] not-arr = 1 hukkin-tomli-7940ff4/tests/data/valid/boolean.json000066400000000000000000000001221513070226000221450ustar00rootroot00000000000000{ "a": {"type":"bool","value":"true"}, "b": {"type":"bool","value":"false"} } hukkin-tomli-7940ff4/tests/data/valid/boolean.toml000066400000000000000000000000221513070226000221460ustar00rootroot00000000000000'a'=true "b"=falsehukkin-tomli-7940ff4/tests/data/valid/dates-and-times/000077500000000000000000000000001513070226000226175ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/dates-and-times/datetimes.json000066400000000000000000000003351513070226000254720ustar00rootroot00000000000000{ "local-dt": {"type":"datetime-local","value":"1988-10-27t01:01:01"}, "local-dt-no-seconds": {"type":"datetime-local","value":"2025-04-18t20:05:00"}, "zulu-dt": {"type":"datetime","value":"1988-10-27t01:01:01z"} } hukkin-tomli-7940ff4/tests/data/valid/dates-and-times/datetimes.toml000066400000000000000000000001371513070226000254740ustar00rootroot00000000000000local-dt=1988-10-27t01:01:01 local-dt-no-seconds=2025-04-18T20:05 zulu-dt=1988-10-27t01:01:01z hukkin-tomli-7940ff4/tests/data/valid/dates-and-times/localtime.json000066400000000000000000000001531513070226000254620ustar00rootroot00000000000000{"t": {"type":"time-local","value":"00:00:00.999999"}, "t2": {"type":"time-local","value":"00:00:00"}} hukkin-tomli-7940ff4/tests/data/valid/dates-and-times/localtime.toml000066400000000000000000000000421513070226000254610ustar00rootroot00000000000000t=00:00:00.99999999999999 t2=00:00hukkin-tomli-7940ff4/tests/data/valid/five-quotes.json000066400000000000000000000002331513070226000230000ustar00rootroot00000000000000{ "five-quotes": {"type":"string","value":"Closing with five quotes\n\"\""}, "four-quotes": {"type":"string","value":"Closing with four quotes\n\""} } hukkin-tomli-7940ff4/tests/data/valid/five-quotes.toml000066400000000000000000000001411513070226000230000ustar00rootroot00000000000000five-quotes = """ Closing with five quotes """"" four-quotes = """ Closing with four quotes """" hukkin-tomli-7940ff4/tests/data/valid/hex-char.json000066400000000000000000000001651513070226000222340ustar00rootroot00000000000000{ "a": {"type":"string","value":"a"}, "b": {"type":"string","value":"b"}, "c": {"type":"string","value":"c"} } hukkin-tomli-7940ff4/tests/data/valid/hex-char.toml000066400000000000000000000000441513070226000222320ustar00rootroot00000000000000a="\u0061" b="\u0062" c="\U00000063"hukkin-tomli-7940ff4/tests/data/valid/inline-table/000077500000000000000000000000001513070226000222035ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/inline-table/empty-inline-table.json000066400000000000000000000000161513070226000265720ustar00rootroot00000000000000{"empty": {}}hukkin-tomli-7940ff4/tests/data/valid/inline-table/empty-inline-table.toml000066400000000000000000000000431513070226000265740ustar00rootroot00000000000000empty ={ }#nothing here hukkin-tomli-7940ff4/tests/data/valid/inline-table/multiline-inline-table.json000066400000000000000000000007601513070226000274440ustar00rootroot00000000000000{ "multiline": { "a": { "type": "integer", "value": "1" }, "b": { "type": "integer", "value": "2" }, "c": [ { "type": "integer", "value": "1" }, { "type": "integer", "value": "2" }, { "type": "integer", "value": "3" } ], "d": { "type": "integer", "value": "3" }, "e": { "type": "integer", "value": "4" }, "f": {} } }hukkin-tomli-7940ff4/tests/data/valid/inline-table/multiline-inline-table.toml000066400000000000000000000002341513070226000274420ustar00rootroot00000000000000multiline = { "a" = 1, "b" = 2, c = [ 1, 2, 3, ],# comment d = 3, e = 4, f = { # comment }, } hukkin-tomli-7940ff4/tests/data/valid/multiline-basic-str/000077500000000000000000000000001513070226000235275ustar00rootroot00000000000000hukkin-tomli-7940ff4/tests/data/valid/multiline-basic-str/ends-in-whitespace-escape.json000066400000000000000000000000661513070226000313510ustar00rootroot00000000000000{"beee": {"type": "string", "value": "heeee\ngeeee"}} hukkin-tomli-7940ff4/tests/data/valid/multiline-basic-str/ends-in-whitespace-escape.toml000066400000000000000000000000461513070226000313510ustar00rootroot00000000000000beee = """ heeee geeee\ """ hukkin-tomli-7940ff4/tests/data/valid/multiline-basic-str/replacements.json000066400000000000000000000002661513070226000271100ustar00rootroot00000000000000{ "escape": {"type":"string","value":"\u001B"}, "tab": {"type":"string","value":"\t"}, "upper-j": {"type":"string","value":"J"}, "upper-j-2": {"type":"string","value":"J"} } hukkin-tomli-7940ff4/tests/data/valid/multiline-basic-str/replacements.toml000066400000000000000000000000771513070226000271120ustar00rootroot00000000000000escape = "\e" tab = "\x09" upper-j = "\x4a" upper-j-2 = "\x4A" hukkin-tomli-7940ff4/tests/data/valid/no-newlines.json000066400000000000000000000000031513070226000227620ustar00rootroot00000000000000{} hukkin-tomli-7940ff4/tests/data/valid/no-newlines.toml000066400000000000000000000000301513070226000227640ustar00rootroot00000000000000#no newlines at all herehukkin-tomli-7940ff4/tests/data/valid/trailing-comma.json000066400000000000000000000001321513070226000234320ustar00rootroot00000000000000{"arr": {"type":"array","value": [ {"type":"integer","value":"1"} ] } } hukkin-tomli-7940ff4/tests/data/valid/trailing-comma.toml000066400000000000000000000000101513070226000234270ustar00rootroot00000000000000arr=[1,]hukkin-tomli-7940ff4/tests/test_data.py000066400000000000000000000032311513070226000201510ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. import json from pathlib import Path import unittest from . import burntsushi, tomllib DATA_DIR = Path(__file__).parent / "data" VALID_FILES = tuple((DATA_DIR / "valid").glob("**/*.toml")) assert VALID_FILES, "Valid TOML test files not found" _expected_files = [] for p in VALID_FILES: json_path = p.with_suffix(".json") text = json.loads(json_path.read_bytes().decode()) _expected_files.append(text) VALID_FILES_EXPECTED = tuple(_expected_files) INVALID_FILES = tuple((DATA_DIR / "invalid").glob("**/*.toml")) assert INVALID_FILES, "Invalid TOML test files not found" class TestData(unittest.TestCase): def test_invalid(self): for invalid in INVALID_FILES: with self.subTest(msg=invalid.stem): toml_bytes = invalid.read_bytes() try: toml_str = toml_bytes.decode() except UnicodeDecodeError: # Some BurntSushi tests are not valid UTF-8. Skip those. continue with self.assertRaises(tomllib.TOMLDecodeError): tomllib.loads(toml_str) def test_valid(self): for valid, expected in zip(VALID_FILES, VALID_FILES_EXPECTED): with self.subTest(msg=valid.stem): toml_str = valid.read_bytes().decode() actual = tomllib.loads(toml_str) actual = burntsushi.convert(actual) # type: ignore[no-untyped-call] expected = burntsushi.normalize(expected) self.assertEqual(actual, expected) hukkin-tomli-7940ff4/tests/test_error.py000066400000000000000000000074141513070226000204000ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations from typing import Any import unittest from . import tomllib class TestError(unittest.TestCase): def test_line_and_col(self): with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads("val=.") self.assertEqual(str(exc_info.exception), "Invalid value (at line 1, column 5)") with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads(".") self.assertEqual( str(exc_info.exception), "Invalid statement (at line 1, column 1)" ) with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads("\n\nval=.") self.assertEqual(str(exc_info.exception), "Invalid value (at line 3, column 5)") with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads("\n\n.") self.assertEqual( str(exc_info.exception), "Invalid statement (at line 3, column 1)" ) def test_missing_value(self): with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads("\n\nfwfw=") self.assertEqual(str(exc_info.exception), "Invalid value (at end of document)") def test_invalid_char_quotes(self): with self.assertRaises(tomllib.TOMLDecodeError) as exc_info: tomllib.loads("v = '\n'") self.assertTrue(" '\\n' " in str(exc_info.exception)) def test_type_error(self): with self.assertRaises(TypeError) as exc_info: tomllib.loads(b"v = 1") # type: ignore[arg-type] # Mypyc extension leads to different message than pure Python self.assertIn( str(exc_info.exception), ("Expected str object, not 'bytes'", "str object expected; got bytes"), ) with self.assertRaises(TypeError) as exc_info: tomllib.loads(False) # type: ignore[arg-type] # Mypyc extension leads to different message than pure Python self.assertIn( str(exc_info.exception), ("Expected str object, not 'bool'", "str object expected; got bool"), ) def test_invalid_parse_float(self): def dict_returner(s: str) -> dict[Any, Any]: return {} def list_returner(s: str) -> list[Any]: return [] for invalid_parse_float in (dict_returner, list_returner): with self.assertRaises(ValueError) as exc_info: tomllib.loads("f=0.1", parse_float=invalid_parse_float) self.assertEqual( str(exc_info.exception), "parse_float must not return dicts or lists" ) def test_deprecated_tomldecodeerror(self): for args in [ (), ("err msg",), (None,), (None, "doc"), ("err msg", None), (None, "doc", None), ("err msg", "doc", None), ("one", "two", "three", "four"), ("one", "two", 3, "four", "five"), ]: with self.assertWarns(DeprecationWarning): e = tomllib.TOMLDecodeError(*args) # type: ignore[arg-type] self.assertEqual(e.args, args) def test_tomldecodeerror(self): msg = "error parsing" doc = "v=1\n[table]\nv='val'" pos = 13 formatted_msg = "error parsing (at line 3, column 2)" e = tomllib.TOMLDecodeError(msg, doc, pos) self.assertEqual(e.args, (formatted_msg,)) self.assertEqual(str(e), formatted_msg) self.assertEqual(e.msg, msg) self.assertEqual(e.doc, doc) self.assertEqual(e.pos, pos) self.assertEqual(e.lineno, 3) self.assertEqual(e.colno, 2) hukkin-tomli-7940ff4/tests/test_misc.py000066400000000000000000000111451513070226000201760ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. import copy import datetime from decimal import Decimal as D import importlib from pathlib import Path import sys import tempfile import unittest from . import tomllib class TestMiscellaneous(unittest.TestCase): def test_load(self): content = "one=1 \n two='two' \n arr=[]" expected = {"one": 1, "two": "two", "arr": []} with tempfile.TemporaryDirectory() as tmp_dir_path: file_path = Path(tmp_dir_path) / "test.toml" file_path.write_text(content) with open(file_path, "rb") as bin_f: actual = tomllib.load(bin_f) self.assertEqual(actual, expected) def test_incorrect_load(self): content = "one=1" with tempfile.TemporaryDirectory() as tmp_dir_path: file_path = Path(tmp_dir_path) / "test.toml" file_path.write_text(content) with open(file_path, "r") as txt_f: with self.assertRaises(TypeError) as exc_info: tomllib.load(txt_f) # type: ignore[arg-type] # Mypyc extension leads to different message than pure Python self.assertIn( str(exc_info.exception), ( "File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`", # noqa: E501 "bytes object expected; got str", ), ) def test_parse_float(self): doc = """ val=0.1 biggest1=inf biggest2=+inf smallest=-inf notnum1=nan notnum2=-nan notnum3=+nan """ obj = tomllib.loads(doc, parse_float=D) expected = { "val": D("0.1"), "biggest1": D("inf"), "biggest2": D("inf"), "smallest": D("-inf"), "notnum1": D("nan"), "notnum2": D("-nan"), "notnum3": D("nan"), } for k, expected_val in expected.items(): actual_val = obj[k] self.assertIsInstance(actual_val, D) if actual_val.is_nan(): self.assertTrue(expected_val.is_nan()) else: self.assertEqual(actual_val, expected_val) def test_deepcopy(self): doc = """ [bliibaa.diibaa] offsettime=[1979-05-27T00:32:00.999999-07:00] """ obj = tomllib.loads(doc) obj_copy = copy.deepcopy(obj) self.assertEqual(obj_copy, obj) expected_obj = { "bliibaa": { "diibaa": { "offsettime": [ datetime.datetime( 1979, 5, 27, 0, 32, 0, 999999, tzinfo=datetime.timezone(datetime.timedelta(hours=-7)), ) ] } } } self.assertEqual(obj_copy, expected_obj) def test_inline_array_recursion_limit(self): nest_count = 470 recursive_array_toml = "arr = " + nest_count * "[" + nest_count * "]" tomllib.loads(recursive_array_toml) nest_count = sys.getrecursionlimit() + 2 recursive_array_toml = "arr = " + nest_count * "[" + nest_count * "]" with self.assertRaisesRegex( RecursionError, r"maximum recursion depth exceeded" r"|" r"TOML inline arrays/tables are nested more than the allowed [0-9]+ levels", ): tomllib.loads(recursive_array_toml) def test_inline_table_recursion_limit(self): nest_count = 310 recursive_table_toml = nest_count * "key = {" + nest_count * "}" tomllib.loads(recursive_table_toml) nest_count = sys.getrecursionlimit() + 2 recursive_table_toml = nest_count * "key = {" + nest_count * "}" with self.assertRaisesRegex( RecursionError, r"maximum recursion depth exceeded" r"|" r"TOML inline arrays/tables are nested more than the allowed [0-9]+ levels", ): tomllib.loads(recursive_table_toml) def test_types_import(self): """Test that `_types` module runs. The module is for type annotations only, so it is otherwise never imported by tests. """ importlib.import_module(f"{tomllib.__name__}._types") hukkin-tomli-7940ff4/tomllib.md000066400000000000000000000033601513070226000164540ustar00rootroot00000000000000# `tomllib` – Tomli in the standard library Tomli was added to the Python standard library in Python 3.11. Relevant links: - Python Issue Tracker: https://bugs.python.org/issue40059 - Tomli issue tracker: https://github.com/hukkin/tomli/issues/141 - Discussion on PyPA "blessing" a TOML parser and/or including one in the standard library: https://discuss.python.org/t/adopting-recommending-a-toml-parser/4068 - Python Enhancement Proposal: https://peps.python.org/pep-0680 - CPython pull request: https://github.com/python/cpython/pull/31498 ## Converting Tomli to tomllib ### Sync status `tomllib` in CPython commit https://github.com/python/cpython/commit/deaf509e8fc6e0363bd6f26d52ad42f976ec42f2 matches Tomli commit https://github.com/hukkin/tomli/commit/7e563eed5286b5d46b8290a9f56a86d955b23a9a ### Steps to convert - Move everything in `tomli:src/tomli` to `cpython:Lib/tomllib`. Exclude `py.typed`. - Remove `__version__ = ...` line from `cpython:Lib/tomllib/__init__.py` - Move everything in `tomli:tests` to `cpython:Lib/test/test_tomllib`. Exclude the following test data dirs recursively: - `tomli:tests/data/invalid/_external/` - `tomli:tests/data/valid/_external/` - Create `cpython:Lib/test/test_tomllib/__main__.py`: ```python import unittest from . import load_tests unittest.main() ``` - Add the following to `cpython:Lib/test/test_tomllib/__init__.py`: ```python import os from test.support import load_package_tests def load_tests(*args): return load_package_tests(os.path.dirname(__file__), *args) ``` Also change `import tomli as tomllib` to `import tomllib`. - In `cpython:Lib/tomllib/_parser.py` replace `__fp` with `fp` and `__s` with `s`. Add the `/` to `load` and `loads` function signatures.