diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-16 11:03:27 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-02-16 11:03:27 +0100 |
commit | 235b8ce21d6a24f01e73ed745f32487553b6d231 (patch) | |
tree | a5f9ccb5d3169d64e8b51faea1f773702e70f668 /test/core | |
parent | 884c7d772da6ad9869866f8a7a15bd08a15376ba (diff) |
Fixed bug #61 and added unit test
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/common/VariantReaderTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/core/common/VariantReaderTest.cpp b/test/core/common/VariantReaderTest.cpp index a23af09..79e567b 100644 --- a/test/core/common/VariantReaderTest.cpp +++ b/test/core/common/VariantReaderTest.cpp @@ -1153,6 +1153,18 @@ TEST(VariantReader, parseGenericString) ASSERT_EQ(0U, loc.getStart()); ASSERT_EQ(15U, loc.getEnd()); } + + // Parse empty string + { + auto res = VariantReader::parseGenericString("", logger); + ASSERT_TRUE(res.first); + ASSERT_TRUE(res.second.isString()); + ASSERT_EQ("", res.second.asString()); + + SourceLocation loc = res.second.getLocation(); + ASSERT_EQ(0U, loc.getStart()); + ASSERT_EQ(0U, loc.getEnd()); + } } TEST(VariantReader, parseGenericComplex) |