diff options
-rw-r--r-- | test/formats/osml/OsmlParserTest.cpp | 14 | ||||
-rw-r--r-- | testdata/osmlparser/struct_with_no_field.osml | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/formats/osml/OsmlParserTest.cpp b/test/formats/osml/OsmlParserTest.cpp index 3472e5f..4cda20a 100644 --- a/test/formats/osml/OsmlParserTest.cpp +++ b/test/formats/osml/OsmlParserTest.cpp @@ -158,5 +158,19 @@ TEST(OsmlParser, structureInheritance) ASSERT_TRUE(node != nullptr); ASSERT_TRUE(node->isa(&RttiTypes::Domain)); } + +TEST(OsmlParser, structWithNoField) +{ + OsmlStandaloneEnvironment env(logger); + logger.reset(); + + Rooted<Node> node = env.parse("struct_with_no_field.osml", "", "", + RttiSet{&RttiTypes::Node}); + ASSERT_FALSE(logger.hasError()); + + ASSERT_TRUE(node != nullptr); + ASSERT_TRUE(node->isa(&RttiTypes::Document)); +} + } diff --git a/testdata/osmlparser/struct_with_no_field.osml b/testdata/osmlparser/struct_with_no_field.osml new file mode 100644 index 0000000..8cf2d02 --- /dev/null +++ b/testdata/osmlparser/struct_with_no_field.osml @@ -0,0 +1,12 @@ +\document + +\domain#test + \struct#a[isRoot=true] + \field + \childRef[ref=b] + \struct#b + +\a + \b + \b + |