Skip to content

Conversation

@rory-cd
Copy link

@rory-cd rory-cd commented Jan 26, 2026

Description

This PR continues on from #122, created by former contributor @ConnorClancyDeakin.

Original PR Description

The goal here was to implement additional testing so that the JSON_unit_test also checks that it can read different number types, other sections already test the INT reading so this just tests the double and float reading in order to make sure the number is correct and the type is correct

The test section is Json can be created and read with different number types, in the test case of json can be created and read.

Continuation

The original PR had 2 reviews. The last reviewer asked to include the relevant using directive at top of file:
using Catch::Matchers::WithinRel;

This PR addresses the request, amends a formatting issue (the last test case was incorrectly nested) and adjusts the sequence of free_json calls accordingly.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Built the test project as per unit testing instructions, running skunit_tests with all tests passed. Test was also run with more specificity using ./skunit_tests [json_as_number] -s

Testing Checklist

  • Tested with skunit_tests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

ConnorClancyDeakin and others added 12 commits July 27, 2025 21:35
Co-authored-by: Daniel Carroll <6995669+dijidiji@users.noreply.github.com>
Co-authored-by: Daniel Carroll <6995669+dijidiji@users.noreply.github.com>
Co-authored-by: Daniel Carroll <6995669+dijidiji@users.noreply.github.com>
- Remove unnecessary braces
- Add newline at end of file
- Add generic [json] tag
- Revert removal of free_json(person)
- Add edge case testing
Non-numeric types should be converted to 0.0, regardless of whether they are numeric (e.g. "2.1")
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