Shared test harness and case corpus for YINI parser implementations.
Project description
yini-test-suite
yini-test-suite is the shared command-line test runner and case corpus for
YINI parser implementations.
It does not parse YINI itself. Instead, it calls a parser implementation through an adapter, compares the parser output with the expected JSON for each case, and reports pass/fail results consistently.
The goal is to give different YINI parsers the same conformance target.
Install
python -m pip install yini-test-suite
Check that the CLI is available:
yini-test-suite --help
The package includes the shared smoke and golden case corpus, so normal installed
usage does not require a separate --cases-root path.
Basic Usage
Run the smoke suite against a parser adapter:
yini-test-suite smoke --adapter python path/to/adapter.py --input {input} --mode {mode}
Run all bundled cases in both lenient and strict mode:
yini-test-suite all --all-modes --adapter python path/to/adapter.py --input {input} --mode {mode}
Important: --adapter must be the last yini-test-suite option. Everything
after --adapter is treated as part of the adapter command.
The runner replaces:
{input}with the current.yinicase path.{mode}withlenientorstrict.
Use --show-progress if you also want a RUN line before each case:
yini-test-suite all --all-modes --show-progress --adapter python path/to/adapter.py --input {input} --mode {mode}
Suites And Modes
Suites:
smokeruns a smaller confidence suite.goldenruns the broader fixed-output conformance suite.allruns bothsmokeandgolden.
Modes:
- Lenient mode is the default.
--strictruns strict-mode cases.--all-modesruns both lenient and strict mode and prints one combined summary.
Adapter Contract
An adapter is a small command-line program owned by a parser implementation. It
accepts an input file and parser mode, then prints parsed JSON to stdout on
success or diagnostics to stderr on failure.
The expected shape is:
adapter --input <path-to-yini-file> --mode <lenient|strict>
For details, see docs/adapter-contract.md.
Official Ecosystem Examples
Parser-specific adapter scripts are maintained in their parser repositories, not in this runner package.
However, this project provides official adapter integrations for
yini-parser-typescript and yini-parser-python through ready-made command
examples and Taskfile tasks. They are included to show working examples and
because those parsers are part of the official YINI ecosystem.
The expected sibling repository layout for those examples is:
YINI-lang-WORK/
yini-test-suite/
yini-parser-typescript/
yini-parser-python/
Example TypeScript adapter command:
yini-test-suite all --all-modes --adapter node ../yini-parser-typescript/dist-tools/tools/yini-test-adapter.js --input {input} --mode {mode}
Example Python adapter command:
yini-test-suite all --all-modes --adapter python ../yini-parser-python/tools/yini_parser_adapter.py --input {input} --mode {mode}
When working from the source repository, the matching Taskfile commands are:
task run-all-typescript
task run-all-python
If these runs expose parser or adapter problems, fix those issues in the corresponding parser repository unless the shared case corpus or runner contract is wrong.
Output
A run starts with the runner name and version:
yini-test-suite 0.3.0b2
Each case is reported as PASS or FAIL, followed by a final summary:
YINI Test Suite Summary
yini-test-suite: 0.3.0b2
Adapter: yini-parser-typescript
Parser version: 1.6.1
YINI spec: 1.0.0 RC 6
Test suite: "all"
For valid cases, the runner compares the adapter JSON output with the matching
expected .json file. Warning cases also check expected warning diagnostics.
Invalid cases are expected to fail.
What This Package Does Not Do
- It does not contain a YINI parser.
- It does not define parser-specific parsing behavior.
- It does not make parser-specific adapters part of the public
yini-test-suitePython API.
Development
For source checkout setup, Taskfile commands, local adapter runs, build checks, and troubleshooting, see docs/Development-Setup.md.
Useful maintainer references:
About YINI
YINI is a human-readable, INI-inspired, indentation-insensitive configuration format with clear nested sections, explicit structure, and predictable parsing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yini_test_suite-0.3.0b2.tar.gz.
File metadata
- Download URL: yini_test_suite-0.3.0b2.tar.gz
- Upload date:
- Size: 76.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7afbf4bb511495a37596dea42cd61022b99f7a60665b96a034a544e9f91d0124
|
|
| MD5 |
fe2f9d216fbc69da85402e0690f70ee5
|
|
| BLAKE2b-256 |
0af68d1907664a5d84c2c34e99214a6bd70deebdd594563eeef6cfa2a0809304
|
File details
Details for the file yini_test_suite-0.3.0b2-py3-none-any.whl.
File metadata
- Download URL: yini_test_suite-0.3.0b2-py3-none-any.whl
- Upload date:
- Size: 241.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d6172739a3dda9eb85da23280b6dc693416ecda87ad890d7b76768ed850a7d
|
|
| MD5 |
6cd9d73ffcafca2bc060863775c00e6e
|
|
| BLAKE2b-256 |
825b5be3e24de4e3effe5c6704c8a667c46cde139080af095c0921a5de86edc2
|