-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: forward start model parameters (#1825)
Co-authored-by: vansangpfiev <[email protected]>
- Loading branch information
1 parent
fb72167
commit 1a73c0c
Showing
5 changed files
with
116 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,61 @@ TEST(ParseJsonStringTest, EmptyString) { | |
|
||
EXPECT_TRUE(result.isNull()); | ||
} | ||
|
||
TEST(MergeJsonTest, MergeSimpleObjects) { | ||
Json::Value json1, json2; | ||
json1["name"] = "John"; | ||
json1["age"] = 30; | ||
|
||
json2["age"] = 31; | ||
json2["email"] = "[email protected]"; | ||
|
||
json_helper::MergeJson(json1, json2); | ||
|
||
Json::Value expected; | ||
expected["name"] = "John"; | ||
expected["age"] = 31; | ||
expected["email"] = "[email protected]"; | ||
|
||
EXPECT_EQ(json1, expected); | ||
} | ||
|
||
TEST(MergeJsonTest, MergeNestedObjects) { | ||
Json::Value json1, json2; | ||
json1["person"]["name"] = "John"; | ||
json1["person"]["age"] = 30; | ||
|
||
json2["person"]["age"] = 31; | ||
json2["person"]["email"] = "[email protected]"; | ||
|
||
json_helper::MergeJson(json1, json2); | ||
|
||
Json::Value expected; | ||
expected["person"]["name"] = "John"; | ||
expected["person"]["age"] = 31; | ||
expected["person"]["email"] = "[email protected]"; | ||
|
||
EXPECT_EQ(json1, expected); | ||
} | ||
|
||
TEST(MergeJsonTest, MergeArrays) { | ||
Json::Value json1, json2; | ||
json1["hobbies"] = Json::Value(Json::arrayValue); | ||
json1["hobbies"].append("reading"); | ||
json1["hobbies"].append("painting"); | ||
|
||
json2["hobbies"] = Json::Value(Json::arrayValue); | ||
json2["hobbies"].append("hiking"); | ||
json2["hobbies"].append("painting"); | ||
|
||
json_helper::MergeJson(json1, json2); | ||
|
||
Json::Value expected; | ||
expected["hobbies"] = Json::Value(Json::arrayValue); | ||
expected["hobbies"].append("reading"); | ||
expected["hobbies"].append("painting"); | ||
expected["hobbies"].append("hiking"); | ||
expected["hobbies"].append("painting"); | ||
|
||
EXPECT_EQ(json1, expected); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters