Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 9, 2025

This PR adds two real-world JSON5 configuration files to the test suite along with corresponding unit tests to validate the parser's ability to handle complex, production-grade JSON5 files.

Changes Made

New Test Files Added

  • lib/src/test/resources/harmonyos-ide-hvigor-build-profile-V13.json5 - A comprehensive HarmonyOS IDE build configuration file with nested objects, arrays, and extensive use of JSON5 features like comments and trailing commas
  • lib/src/test/resources/blink-renderer-core-frame-settings.json5 - A large Blink renderer configuration file (1,158 lines) demonstrating the parser's capability with complex real-world configurations

New Unit Tests Added

  • testParseHarmonyOSBuildProfileJson5() - Validates parsing of the HarmonyOS build profile, checking key structural elements like app, modules, signingConfigs, products, and buildModeSet
  • testParseBlinkRendererFrameSettingsJson5() - Validates parsing of the Blink renderer settings, verifying the parameters and data sections with their respective properties

Testing

Both new tests successfully parse their respective files and validate key structural elements without breaking any existing functionality. All 127 tests in the test suite continue to pass.

These additions demonstrate the JSON5 parser's robustness with:

  • Complex nested object structures
  • Extensive use of single-line (//) and multi-line (/* */) comments
  • Trailing commas in objects and arrays
  • Mixed quoting styles
  • Large file sizes and deep nesting

Fixes #29.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add real life JSON5 to unit test Add real-life JSON5 files and corresponding unit tests Jun 9, 2025
Copilot AI requested a review from hossain-khan June 9, 2025 13:30
Copilot finished work on behalf of hossain-khan June 9, 2025 13:30
@hossain-khan hossain-khan marked this pull request as ready for review June 9, 2025 13:31
@hossain-khan hossain-khan merged commit b13cf52 into main Jun 9, 2025
1 check passed
@hossain-khan hossain-khan deleted the copilot/fix-29 branch June 9, 2025 13:31
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.

Add real life JSON5 to unit test

2 participants