{"sha":"9b78d464b448719bba5ed1ec32506932df06beb1","node_id":"MDY6Q29tbWl0MzUwOTA2ODY6OWI3OGQ0NjRiNDQ4NzE5YmJhNWVkMWVjMzI1MDY5MzJkZjA2YmViMQ==","commit":{"author":{"name":"David Nickerson","email":"nickerso@users.sourceforge.net","date":"2017-09-05T12:27:22Z"},"committer":{"name":"David Nickerson","email":"nickerso@users.sourceforge.net","date":"2017-09-05T12:27:22Z"},"message":"adding test to illustrate #183.\n\nNew test parses a model which contains a component with multiple math children,\nwhich is expected to parse fine. Due to #183 this is not the case and one of the\nmath children is discarded.","tree":{"sha":"40393bfac5ff7308fed43c7abf7a3d53be8e6ea6","url":"https://api.github.com/repos/nickerso/libcellml/git/trees/40393bfac5ff7308fed43c7abf7a3d53be8e6ea6"},"url":"https://api.github.com/repos/nickerso/libcellml/git/commits/9b78d464b448719bba5ed1ec32506932df06beb1","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/nickerso/libcellml/commits/9b78d464b448719bba5ed1ec32506932df06beb1","html_url":"https://github.com/nickerso/libcellml/commit/9b78d464b448719bba5ed1ec32506932df06beb1","comments_url":"https://api.github.com/repos/nickerso/libcellml/commits/9b78d464b448719bba5ed1ec32506932df06beb1/comments","author":null,"committer":null,"parents":[{"sha":"07120c31dd6622fc442c505aa95510148df78498","url":"https://api.github.com/repos/nickerso/libcellml/commits/07120c31dd6622fc442c505aa95510148df78498","html_url":"https://github.com/nickerso/libcellml/commit/07120c31dd6622fc442c505aa95510148df78498"}],"stats":{"total":74,"additions":73,"deletions":1},"files":[{"sha":"3c1065d36ad56e4c5d1c3d82b514a742d630b987","filename":"tests/parser/file_parser.cpp","status":"modified","additions":21,"deletions":0,"changes":21,"blob_url":"https://github.com/nickerso/libcellml/blob/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Fparser%2Ffile_parser.cpp","raw_url":"https://github.com/nickerso/libcellml/raw/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Fparser%2Ffile_parser.cpp","contents_url":"https://api.github.com/repos/nickerso/libcellml/contents/tests%2Fparser%2Ffile_parser.cpp?ref=9b78d464b448719bba5ed1ec32506932df06beb1","patch":"@@ -108,3 +108,24 @@ TEST(Parser, parseComplexEncapsulationModelFromFile) {\n EXPECT_EQ(0, p.errorCount());\n }\n \n+TEST(Parser, parseModelWithComponentsWithMultipleMathElements) {\n+ // This test resulted from https://github.com/cellml/libcellml/issues/183\n+ std::ifstream t(TestResources::getLocation(\n+ TestResources::CELLML_A_PLUS_B_MODEL_RESOURCE));\n+ std::stringstream buffer;\n+ buffer << t.rdbuf();\n+\n+ libcellml::Parser p(libcellml::Format::XML);\n+ libcellml::ModelPtr model = p.parseModel(buffer.str());\n+ EXPECT_EQ(0, p.errorCount());\n+\n+ std::string e1 = \"\";\n+ std::string e2 = \"\\n\\t\\t\";\n+\n+ std::string a = model->getComponent(\"c1\")->getMath();\n+ EXPECT_EQ(e1, a);\n+\n+ a = model->getComponent(\"c2\")->getMath();\n+ EXPECT_EQ(e2, a);\n+}\n+"},{"sha":"3a8e31d2b5524a266f2ba3a0488ed233fde6163c","filename":"tests/resources/a_plus_b.cellml","status":"added","additions":45,"deletions":0,"changes":45,"blob_url":"https://github.com/nickerso/libcellml/blob/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Fresources%2Fa_plus_b.cellml","raw_url":"https://github.com/nickerso/libcellml/raw/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Fresources%2Fa_plus_b.cellml","contents_url":"https://api.github.com/repos/nickerso/libcellml/contents/tests%2Fresources%2Fa_plus_b.cellml?ref=9b78d464b448719bba5ed1ec32506932df06beb1","patch":"@@ -0,0 +1,45 @@\n+\n+\n+\t\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\t\n+\t\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\t\n+\t\n+\t\t\n+\t\t\n+\t\t\n+\t\n+"},{"sha":"d3ace75358e87ac4181ba91ef12f058eb99b8c12","filename":"tests/test_resources.cmake","status":"modified","additions":1,"deletions":0,"changes":1,"blob_url":"https://github.com/nickerso/libcellml/blob/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Ftest_resources.cmake","raw_url":"https://github.com/nickerso/libcellml/raw/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Ftest_resources.cmake","contents_url":"https://api.github.com/repos/nickerso/libcellml/contents/tests%2Ftest_resources.cmake?ref=9b78d464b448719bba5ed1ec32506932df06beb1","patch":"@@ -3,6 +3,7 @@ set(CELLML_SINE_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_appro\n set(CELLML_SINE_IMPORTS_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/sine_approximations_import.xml\")\n set(CELLML_COMPLEX_ENCAPSULATION_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/complex_encapsulation.xml\")\n set(CELLML_ORD_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/Ohara_Rudy_2011.cellml\")\n+set(CELLML_A_PLUS_B_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/a_plus_b.cellml\")\n set(CELLML_INVALID_MODEL_RESOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/invalid_cellml_2.0.xml\")\n \n set(TEST_RESOURCE_HEADER ${CMAKE_CURRENT_BINARY_DIR}/test_resources.h)"},{"sha":"cd8fc0a07e432cee59ccc74b6ad93ff6dc7ae02d","filename":"tests/test_resources.h.in","status":"modified","additions":6,"deletions":1,"changes":7,"blob_url":"https://github.com/nickerso/libcellml/blob/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Ftest_resources.h.in","raw_url":"https://github.com/nickerso/libcellml/raw/9b78d464b448719bba5ed1ec32506932df06beb1/tests%2Ftest_resources.h.in","contents_url":"https://api.github.com/repos/nickerso/libcellml/contents/tests%2Ftest_resources.h.in?ref=9b78d464b448719bba5ed1ec32506932df06beb1","patch":"@@ -12,7 +12,8 @@ public:\n CELLML_SINE_MODEL_RESOURCE = 2,\n CELLML_SINE_IMPORTS_MODEL_RESOURCE = 3,\n CELLML_ORD_MODEL_RESOURCE = 4,\n- CELLML_COMPLEX_ENCAPSULATION_MODEL_RESOURCE = 5\n+ CELLML_COMPLEX_ENCAPSULATION_MODEL_RESOURCE = 5,\n+ CELLML_A_PLUS_B_MODEL_RESOURCE = 6\n };\n \n TestResources()\n@@ -43,6 +44,10 @@ public:\n {\n return \"@CELLML_ORD_MODEL_RESOURCE@\";\n }\n+ if (resourceName == TestResources::CELLML_A_PLUS_B_MODEL_RESOURCE)\n+ {\n+ return \"@CELLML_A_PLUS_B_MODEL_RESOURCE@\";\n+ }\n return 0;\n }\n };"}]}