Skip to content

Conversation

@rjwalters
Copy link

Summary

This PR adds comprehensive regression tests for issue #361, which reported that ktoml failed to parse valid TOML files with empty lines after table headers.

Background

Issue #361 reported parsing failures when empty lines appeared after TOML table headers (a pattern found in popular Python projects like FastAPI and Black). For example:

[project.optional-dependencies] standard = [ "fastapi-cli[standard] >=0.0.8", "httpx >=0.23.0" ]

This is valid TOML 1.0, but was previously causing MissingRequiredPropertyException in ktoml 0.7.1.

Resolution

All regression tests pass on the current main branch, indicating the issue has been resolved.

The fix likely came through one of these recent PRs:

Test Coverage

This PR adds two test files with comprehensive coverage:

Issue361Test.kt (JVM-specific tests)

  1. testFastAPIWithEmptyLineAfterTableHeader - Exact FastAPI pyproject.toml pattern
  2. testMultipleEmptyLinesAfterTableHeader - Multiple consecutive empty lines
  3. testEmptyLinesWithCommentsAfterTableHeader - Empty lines mixed with comments
  4. testNestedTableWithEmptyLineAfterHeader - Deeply nested tables

RealWorldPythonProjectTest.kt (Cross-platform tests)

  1. testFastAPIStyleEmptyLineAfterTableHeader - Parser-level validation
  2. testEmptyLineAfterTableHeader - Minimal reproduction case
  3. testMultipleEmptyLinesAfterTableHeader - Edge case coverage

Testing

All tests pass:

✓ 7 new regression tests ✓ All existing tests continue to pass ✓ No regressions introduced 

Impact

These regression tests ensure that:

Closes #361


🤖 Generated with Claude Code

… headers) This commit adds comprehensive regression tests to ensure that ktoml correctly handles empty lines after TOML table headers, which is valid per TOML 1.0 spec but was reported as broken in issue orchestr7#361. ## Test Coverage **Issue361Test.kt** - JVM-specific regression tests: - testFastAPIWithEmptyLineAfterTableHeader: Reproduces the exact FastAPI pyproject.toml pattern - testMultipleEmptyLinesAfterTableHeader: Tests multiple consecutive empty lines - testEmptyLinesWithCommentsAfterTableHeader: Tests empty lines mixed with comments - testNestedTableWithEmptyLineAfterHeader: Tests deeply nested tables with empty lines **RealWorldPythonProjectTest.kt** - Cross-platform tests: - testFastAPIStyleEmptyLineAfterTableHeader: Parser-level test - testEmptyLineAfterTableHeader: Minimal reproduction - testMultipleEmptyLinesAfterTableHeader: Edge case testing ## Testing Results All tests pass on the current main branch, indicating that the issue reported in orchestr7#361 has been resolved (likely through PRs orchestr7#353, orchestr7#334, or orchestr7#333). These regression tests ensure the fix remains stable and prevent future regressions of this issue. Closes orchestr7#361 🤖 Generated with [Claude Code](https://claude.com/claude-code)
@rjwalters
Copy link
Author

Not sure what your philosophy is on tests but here are a few if you like having a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant