Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial from json #261

Merged
merged 3 commits into from
Apr 30, 2024
Merged

partial from json #261

merged 3 commits into from
Apr 30, 2024

Conversation

qicosmos
Copy link
Owner

struct some_test_t {
  int id1;
  std::string name;
};
REFLECTION(some_test_t, id1, name);

struct dummy_nest_t {
  int id;
  some_test_t t;
};
REFLECTION(dummy_nest_t, id, t);

TEST_CASE("partial from json") {
  dummy_nest_t t{42, {43, "tom"}};
  std::string str;
  iguana::to_json(t, str);

  {
    dummy_nest_t t1;
    iguana::from_json<&dummy_nest_t::id>(t1, str);
    CHECK(t1.id == 42);
  }
  {
    dummy_nest_t t1;
    iguana::from_json<&dummy_nest_t::t>(t1, str);
    CHECK(t1.t.name == "tom");
  }

  {
    some_test_t t1;
    iguana::from_json<&some_test_t::name, dummy_nest_t>(t1, str);
    CHECK(t1.name == "tom");
  }
}

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.26%. Comparing base (fb6e6d5) to head (01951a9).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #261      +/-   ##
==========================================
+ Coverage   45.02%   45.26%   +0.24%     
==========================================
  Files          46       46              
  Lines        5628     5653      +25     
==========================================
+ Hits         2534     2559      +25     
  Misses       3094     3094              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qicosmos qicosmos merged commit 5de716f into master Apr 30, 2024
20 of 21 checks passed
@qicosmos qicosmos deleted the support_partial_from_json branch April 30, 2024 01:07
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