Skip to main content

Shared test harness and case corpus for YINI parser implementations.

Project description

yini-test-suite

The yini-test-suite tool is the shared case corpus (test harness) for YINI parser implementations.

It does not contain a YINI parser itself. Instead, it invokes a chosen parser implementation through an adapter, compares the actual output with the expected output, and reports pass/fail results consistently.

The goal of yini-test-suite is to stay implementation-agnostic, so that multiple YINI parsers can be tested in a uniform way.


What yini-test-suite does

  • Runs a chosen parser implementation through an adapter.
  • Compares actual output with expected output.
  • Reports pass/fail results consistently.
  • Provides a shared test corpus for multiple YINI parser implementations.

What yini-test-suite does not do

  • It does not contain a YINI parser.
  • It does not contain parser-specific execution logic.
  • It does not own parser-specific adapters.

Quick Start

First-time setup

It is assumed you are in the yini-test-suite/ directory, and that you have the directory yini-parser-python/ already alongside the directory yini-test-suite.

Run:

task clean
task install
task test
task run-smoke-python-lenient
task run-smoke-python-strict

If you want to test the TypeScript parser instead, replace the last command with:

task run-smoke-typescript-lenient
task run-smoke-typescript-strict

Later runs

Run these commands from the yini-test-suite/ directory.

Run:

task run-smoke-python-lenient
task run-smoke-python-strict

or:

task run-smoke-typescript-lenient
task run-smoke-typescript-strict

depending on which parser implementation you want to test.


Expected local repository layout

The predefined Taskfile commands assume that the parser repositories are located next to yini-test-suite:

/
├─ yini-test-suite/
├─ yini-parser-typescript/
└─ yini-parser-python/

Adapter paths are relative to this directory: yini-test-suite/:

  • The TypeScript parser adapter is expected at:
    ../yini-parser-typescript/dist-tools/tools/yini-test-adapter.js
  • The Python parser adapter is expected at:
    ../yini-parser-python/tools/yini_parser_adapter.py

Installing and running tests

1. Clean local cache files

task clean

This removes Python cache files and temporary tool caches.

2. Install dependencies

task install

This installs the development dependencies and installs yini-test-suite itself in editable mode.

3. Show available tasks

task

4. Test yini-test-suite itself

task test

This runs the unit and integration tests for the yini-test-suite runner.

A successful result should look similar to:

34 passed

5. Run smoke tests against yini-parser-python

task run-smoke-python-lenient
task run-smoke-python-strict

This runs the smoke test cases against the Python parser adapter.

The task uses a command similar to:

python -m yini_test smoke \
  --cases-root src/yini_test/cases \
  --adapter python ../yini-parser-python/tools/yini_parser_adapter.py --input {input} --mode {mode}

The {input} and {mode} placeholders are replaced automatically for each test case.

6. Run all Python cases

task run-all-python

This runs the Python adapter against smoke lenient, smoke strict, golden lenient, and golden strict cases, then prints one combined summary.

The task uses:

python -m yini_test all --all-modes \
  --cases-root src/yini_test/cases \
  --adapter python ../yini-parser-python/tools/yini_parser_adapter.py --input {input} --mode {mode}

7. Run all TypeScript cases

task run-all-typescript

This runs the TypeScript adapter against smoke lenient, smoke strict, golden lenient, and golden strict cases, then prints one combined summary.

The task uses:

python -m yini_test all --all-modes \
  --cases-root src/yini_test/cases \
  --adapter node ../yini-parser-typescript/dist-tools/tools/yini-test-adapter.js --input {input} --mode {mode}

8. Understanding the result

Each case is reported as PASS or FAIL.

Example:

PASS  "cases\smoke\lenient\valid\1-minimal.yini"
FAIL  "cases\smoke\lenient\valid\3-nested-sections.yini"

Use --show-progress to also print a RUN line before each case executes.

For valid cases, yini-test-suite compares the parser output with the matching expected JSON file.

For example:

cases/smoke/lenient/valid/3-nested-sections.yini

is compared with:

cases/smoke/lenient/valid/3-nested-sections.json

If a test case fails, yini-test-suite prints the difference showing the expected output and the actual parser output.


Project structure

  • src/yini_test/__main__.py is the package entry point.
  • src/yini_test/cli.py handles the command-line argument parsing.
  • src/yini_test/runner.py contains the core test-running logic.
  • src/yini_test/cases/ contains the shared parser test case corpus.
  • tests/ contains tests for this yini-test-suite project itself.

Current case groups include:

  • golden/ for cases where valid input must produce exact expected output.
  • smoke/ for smaller practical cases used to catch obvious parser issues.

Adapters

This project itself does not include adapters for specific parser implementations.

Instead, each parser project/repository should provide and maintain its own adapter logic for yini-test-suite to call.


Related documents


^YINI ≡

YINI is a human-readable, INI-inspired, indentation-insensitive configuration format with clear nested sections, explicit structure, and predictable parsing.

It has a formal specification and a defined grammar.

yini-lang.org · YINI-lang on GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yini_test_suite-0.3.0b1.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yini_test_suite-0.3.0b1-py3-none-any.whl (241.2 kB view details)

Uploaded Python 3

File details

Details for the file yini_test_suite-0.3.0b1.tar.gz.

File metadata

  • Download URL: yini_test_suite-0.3.0b1.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

Hashes for yini_test_suite-0.3.0b1.tar.gz
Algorithm Hash digest
SHA256 1a91a36fefb891d73231bd9587a8dde044831389006df8716a3b79b2555874eb
MD5 0acac54a0ba8199d3bd5a0e886e410b3
BLAKE2b-256 5e69f4b6e619d9a4c71b219456c49d2be5646fff18af76b8689508718a71bcb3

See more details on using hashes here.

File details

Details for the file yini_test_suite-0.3.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for yini_test_suite-0.3.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 d384cd28c91fbb17559340f8c642d0b1904e52efbaa677c8da99350dafb714f4
MD5 10b95143cae42af193ec5c4402fbf324
BLAKE2b-256 835a204f40b5fb8c5c9d8b1cd17f7f20f1496651562334a7c37392a85f11fd02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page