Skip to content
Snippets Groups Projects
Commit d0bfff7c authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Added another test for converter.

parent 6889f3bc
No related branches found
No related tags found
No related merge requests found
Pipeline #3925 failed
...@@ -57,6 +57,19 @@ TEST(Converter, ParseToMap) ...@@ -57,6 +57,19 @@ TEST(Converter, ParseToMap)
map<string, vector<int>> m = {{"x",vector<int>{1,2}}, {"y",vector<int>{}}, {"z",vector<int>{3}}}; map<string, vector<int>> m = {{"x",vector<int>{1,2}}, {"y",vector<int>{}}, {"z",vector<int>{3}}};
ASSERT_EQ(converter<string>::convert(m), "[{x:[1,2]},{y:[]},{z:[3]}]"); ASSERT_EQ(converter<string>::convert(m), "[{x:[1,2]},{y:[]},{z:[3]}]");
} }
TEST(Converter, extraTests)
{
string str = "[{x:1},{y:[[{x:[1,2]},{y:[]},{z:[3]}]]},{z:[1,2,3,4,5]}]";
auto v = converter<vector<string>>::convert(str);
ASSERT_EQ(v[0], "{x:1}");
ASSERT_EQ(v[1], "{y:[[{x:[1,2]},{y:[]},{z:[3]}]]}");
ASSERT_EQ(v[2], "{z:[1,2,3,4,5]}");
string str2 = "[]";
auto v2 = converter<vector<string>>::convert(str2);
// EXPECT_EQ(v2.size(), 1);
EXPECT_TRUE(v2.empty());
}
TEST(Converter, noGeneralConvert) TEST(Converter, noGeneralConvert)
{ {
class DUMMY{}; class DUMMY{};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment