Skip to content

test(json): add Json and Simple round-trip coverage #537

Description

@GaspardKirira

Summary

Add comprehensive round-trip tests between the main JSON model and the Simple value model.

Current behavior

Tests cover conversion from Simple values to Json.

There is no complete round-trip suite validating semantic preservation across nested values.

Expected behavior

Supported values should preserve their meaning through:

  • Simple → Json → Simple;
  • Json → Simple → Json.

The test suite must clearly identify values that cannot be represented losslessly.

Scope

  • Test null round trips.
  • Test boolean round trips.
  • Test signed integer round trips.
  • Test floating-point round trips.
  • Test string round trips.
  • Test nested array round trips.
  • Test nested object round trips.
  • Test empty arrays and objects.
  • Test property ordering.
  • Test unsupported unsigned ranges.
  • Test recursion limits.

Suggested files

  • modules/json/tests/json_simple_roundtrip_test.cpp
  • modules/json/include/vix/json/convert.hpp

Acceptance criteria

  • Supported primitive values round-trip.
  • Nested arrays round-trip.
  • Nested objects round-trip.
  • Empty structures preserve their type.
  • Unsupported values fail with documented diagnostics.
  • No silent numeric narrowing occurs.
  • Existing conversion tests continue to pass.

Non-goals

This issue does not include:

  • byte-for-byte serialized-text equality;
  • arbitrary-precision numbers;
  • duplicate object keys;
  • JSON schema equivalence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersscope:jsonChanges related to the Vix JSON modulestatus:readyIssue is fully specified and ready for implementationtestsTests, CI coverage and validationtype:ciCI, tests, or tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions