Skip to content

Commit

Permalink
added testcase for requested samples from issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gittiver committed Feb 5, 2025
1 parent 3316455 commit 3c82cda
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,25 @@ TEST_CASE("json_list")
CHECK("[5,6,7,8,4,3,2,1]" == x.dump());
} // json_list

static crow::json::wvalue getValue(int i){
return crow::json::wvalue(i);
}

TEST_CASE("json Incorrect move of wvalue class #953")
{
{
crow::json::wvalue int_value(-500);
crow::json::wvalue copy_value(std::move(int_value));

REQUIRE(copy_value.dump()=="-500");
}
{
crow::json::wvalue json;
json["int_value"] = getValue(-500);
REQUIRE(json["int_value"].dump()=="-500");
}
}

TEST_CASE("template_basic")
{
auto t = crow::mustache::compile(R"---(attack of {{name}})---");
Expand Down

0 comments on commit 3c82cda

Please sign in to comment.