Skip to content

Conversation

@hossain-khan
Copy link
Owner

I ran all tests in the lib module, and they all passed after I updated the Gradle version to 8.5 to support Java 21.

I also validated the accuracy of the tests against the JSON5 specification (https://spec.json5.org/). I identified and documented areas where tests validate known parser bugs or where test expectations (or parser behavior) deviate from the spec. These include:

  • JSON5ParseTest:
    • should parse special character property names: Currently tests a parser bug where '$' in unquoted keys is rejected.
    • should parse escaped property names: Currently tests a parser bug where valid escaped characters in unquoted keys are rejected.
    • should parse escaped characters (@ignored): Expected output needs correction for line continuations and '\a'. The parser likely has bugs here.
    • should parse unrecognized simple escapes (@ignored): Test expectations are correct; this test should be unignored after the parser is fixed.
  • JSON5ParseErrorsTest:
    • should throw on escaped digits: Both the test and parser are incorrect; '\1' should parse to "1".

I added KDoc comments to all test classes and methods in:

  • JSON5ParseTest.kt
  • JSON5ParseErrorsTest.kt
  • JSON5ParserTestLargeFile.kt
  • JSON5ParserTextExampleFiles.kt
  • JSON5StringifyTest.kt

The documentation clarifies the purpose of each test, the JSON5 features covered, and includes notes on spec alignment or parser behavior.

I ran all tests in the lib module, and they all passed after I updated the Gradle version to 8.5 to support Java 21.

I also validated the accuracy of the tests against the JSON5 specification (https://spec.json5.org/). I identified and documented areas where tests validate known parser bugs or where test expectations (or parser behavior) deviate from the spec. These include:
- `JSON5ParseTest`:
    - `should parse special character property names`: Currently tests a parser bug where '$' in unquoted keys is rejected.
    - `should parse escaped property names`: Currently tests a parser bug where valid escaped characters in unquoted keys are rejected.
    - `should parse escaped characters` (@ignored): Expected output needs correction for line continuations and '\a'. The parser likely has bugs here.
    - `should parse unrecognized simple escapes` (@ignored): Test expectations are correct; this test should be unignored after the parser is fixed.
- `JSON5ParseErrorsTest`:
    - `should throw on escaped digits`: Both the test and parser are incorrect; '\1' should parse to "1".

I added KDoc comments to all test classes and methods in:
- `JSON5ParseTest.kt`
- `JSON5ParseErrorsTest.kt`
- `JSON5ParserTestLargeFile.kt`
- `JSON5ParserTextExampleFiles.kt`
- `JSON5StringifyTest.kt`

The documentation clarifies the purpose of each test, the JSON5 features covered, and includes notes on spec alignment or parser behavior.
@hossain-khan
Copy link
Owner Author

Cool! let's take it in AS-IS

@hossain-khan hossain-khan merged commit c0d7ea1 into main Jun 8, 2025
1 check passed
@hossain-khan hossain-khan deleted the document-lib-tests branch June 8, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants