Skip to content

Commit 3c82cda

Browse files
committed
added testcase for requested samples from issue
1 parent 3316455 commit 3c82cda

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/unittest.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,25 @@ TEST_CASE("json_list")
14161416
CHECK("[5,6,7,8,4,3,2,1]" == x.dump());
14171417
} // json_list
14181418

1419+
static crow::json::wvalue getValue(int i){
1420+
return crow::json::wvalue(i);
1421+
}
1422+
1423+
TEST_CASE("json Incorrect move of wvalue class #953")
1424+
{
1425+
{
1426+
crow::json::wvalue int_value(-500);
1427+
crow::json::wvalue copy_value(std::move(int_value));
1428+
1429+
REQUIRE(copy_value.dump()=="-500");
1430+
}
1431+
{
1432+
crow::json::wvalue json;
1433+
json["int_value"] = getValue(-500);
1434+
REQUIRE(json["int_value"].dump()=="-500");
1435+
}
1436+
}
1437+
14191438
TEST_CASE("template_basic")
14201439
{
14211440
auto t = crow::mustache::compile(R"---(attack of {{name}})---");

0 commit comments

Comments
 (0)