From f78e654a7bc6510537f71013e0e451cfa5b6e6e1 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 17 Feb 2015 19:38:28 +0100 Subject: Added very primitive unit tests for include --- test/formats/osml/OsmlParserTest.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test') diff --git a/test/formats/osml/OsmlParserTest.cpp b/test/formats/osml/OsmlParserTest.cpp index d12721e..50e0dcb 100644 --- a/test/formats/osml/OsmlParserTest.cpp +++ b/test/formats/osml/OsmlParserTest.cpp @@ -120,5 +120,32 @@ TEST(OsmlParser, inlineDomain) ASSERT_TRUE(node->isa(&RttiTypes::Document)); } +TEST(OsmlParser, include) +{ + OsmlStandaloneEnvironment env(logger); + logger.reset(); + + ASSERT_FALSE(logger.hasError()); + Rooted node = + env.parse("include_root.osml", "", "", RttiSet{&RttiTypes::Node}); + ASSERT_FALSE(logger.hasError()); + + ASSERT_TRUE(node != nullptr); + ASSERT_TRUE(node->isa(&RttiTypes::Document)); +} + +TEST(OsmlParser, includeRecursive) +{ + OsmlStandaloneEnvironment env(logger); + logger.reset(); + + ASSERT_FALSE(logger.hasError()); + Rooted node = env.parse("include_recursive_root.osml", "", "", + RttiSet{&RttiTypes::Node}); + ASSERT_TRUE(logger.hasError()); + + ASSERT_TRUE(node != nullptr); + ASSERT_TRUE(node->isa(&RttiTypes::Document)); +} } -- cgit v1.2.3