mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2026-02-19 06:36:29 +00:00
test: add case demonstrating bug
This commit is contained in:
committed by
Jesse Beder
parent
495cde635d
commit
f3f123cea0
@@ -368,13 +368,18 @@ TEST(NodeTest, LoadCommaSeparatedStrings) {
|
||||
EXPECT_THROW(Load(R"(,foo)"), ParserException);
|
||||
}
|
||||
|
||||
TEST(NodeSpecTest, InfiniteLoopNodes) {
|
||||
TEST(NodeTest, 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);
|
||||
}
|
||||
|
||||
TEST(NodeTest, MultipleDocuments) {
|
||||
std::vector<Node> docs = LoadAll("\n---\n---\nA\n");
|
||||
EXPECT_EQ(docs.size(), 2);
|
||||
}
|
||||
|
||||
struct NewLineStringsTestCase {
|
||||
std::string input;
|
||||
std::string expected_content;
|
||||
|
||||
Reference in New Issue
Block a user