chore(test): moved infiniteloop test to load_node_test suite.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2024-10-14 09:19:43 +02:00
committed by Jesse Beder
parent 29c59c01d4
commit c2bec4c755
3 changed files with 7 additions and 10 deletions

View File

@@ -368,6 +368,13 @@ TEST(NodeTest, LoadCommaSeparatedStrings) {
EXPECT_THROW(Load(R"(,foo)"), ParserException);
}
TEST(NodeSpecTest, 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).
EXPECT_THROW(LoadAll(R"(,)"), ParserException);
}
struct NewLineStringsTestCase {
std::string input;
std::string expected_content;

View File

@@ -941,13 +941,6 @@ TEST(NodeSpecTest, Ex7_24_FlowNodes) {
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) {
Node doc = Load(ex8_1);
EXPECT_EQ(4, doc.size());

View File

@@ -687,9 +687,6 @@ const char *ex7_24 =
"- *anchor\n"
"- !!str";
const char *ex7_25 =
",";
const char *ex8_1 =
"- | # Empty header\n"
" literal\n"