mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
new(test): added a test to avoid future issues with LoadAll().
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:

committed by
Jesse Beder

parent
bc67157109
commit
29c59c01d4
@@ -941,6 +941,13 @@ TEST(NodeSpecTest, Ex7_24_FlowNodes) {
|
|||||||
EXPECT_EQ("", doc[4].as<std::string>());
|
EXPECT_EQ("", doc[4].as<std::string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(NodeSpecTest, Ex7_25_InfiniteLoopNodes) {
|
||||||
|
// Until yaml-cpp <= 0.8.0 this caused an infinite loop;
|
||||||
|
// After, it triggers an exception (but LoadAll is smart enough to avoid
|
||||||
|
// the infinite loop in any case).
|
||||||
|
ASSERT_THROW(LoadAll(ex7_25), ParserException);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(NodeSpecTest, Ex8_1_BlockScalarHeader) {
|
TEST(NodeSpecTest, Ex8_1_BlockScalarHeader) {
|
||||||
Node doc = Load(ex8_1);
|
Node doc = Load(ex8_1);
|
||||||
EXPECT_EQ(4, doc.size());
|
EXPECT_EQ(4, doc.size());
|
||||||
|
@@ -687,6 +687,9 @@ const char *ex7_24 =
|
|||||||
"- *anchor\n"
|
"- *anchor\n"
|
||||||
"- !!str";
|
"- !!str";
|
||||||
|
|
||||||
|
const char *ex7_25 =
|
||||||
|
",";
|
||||||
|
|
||||||
const char *ex8_1 =
|
const char *ex8_1 =
|
||||||
"- | # Empty header\n"
|
"- | # Empty header\n"
|
||||||
" literal\n"
|
" literal\n"
|
||||||
|
Reference in New Issue
Block a user