pdb: meta mapping

This commit is contained in:
Michael Davidsaver
2017-09-28 18:27:40 -05:00
parent e084a9e943
commit b839d5dc6d
5 changed files with 67 additions and 29 deletions

View File

@@ -19,9 +19,12 @@ void test_parse()
" \"fld\":{\n"
" \"+type\": \"simple\","
" \"+putorder\": -4"
" },\n"
" \"\":{\n"
" \"+type\": \"top\""
" }\n"
" },\n"
" \"fld2\":{\n"
" \"grpb\":{\n"
" }\n"
"}";
@@ -36,12 +39,18 @@ void test_parse()
testEqual(conf.groups["grpa"].fields["fld"].type, "simple");
testEqual(conf.groups["grpa"].fields["fld"].channel, "");
testEqual(conf.groups["grpa"].fields["fld"].putorder, -4);
testEqual(conf.groups["grpa"].fields[""].type, "top");
}
void test_fail()
{
testDiag("test_fail()");
{
GroupConfig conf;
testThrows(std::runtime_error, GroupConfig::parse("{", conf));
}
{
GroupConfig conf;
testThrows(std::runtime_error, GroupConfig::parse("{\"G\":{\"F\":{\"K\":{}}}}", conf));
@@ -56,7 +65,7 @@ void test_fail()
MAIN(testanyscalar)
{
testPlan(8);
testPlan(10);
try {
test_parse();
test_fail();