mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 15:36:58 +00:00
This reverts commit 64779455b8f4875c7de690dd4c3e324dbbcb3029.
This commit is contained in:
parent
f3a14217a9
commit
feecb201ab
@ -1273,6 +1273,36 @@ TEST(YAMLIO, TestReadWriteBlockScalarValue) {
|
||||
}
|
||||
}
|
||||
|
||||
struct V {
|
||||
MultilineStringType doc;
|
||||
std::string str;
|
||||
};
|
||||
template <> struct llvm::yaml::MappingTraits<V> {
|
||||
static void mapping(IO &io, V &v) {
|
||||
io.mapRequired("block_scalac", v.doc);
|
||||
io.mapRequired("scalar", v.str);
|
||||
}
|
||||
};
|
||||
template <> struct llvm::yaml::SequenceElementTraits<V> {
|
||||
static const bool flow = false;
|
||||
};
|
||||
TEST(YAMLIO, TestScalarAfterBlockScalar) {
|
||||
std::vector<V> v{V{}};
|
||||
v[0].doc.str = "AA\nBB";
|
||||
v[0].str = "a";
|
||||
std::string output;
|
||||
llvm::raw_string_ostream ostr(output);
|
||||
Output yout(ostr);
|
||||
yout << v;
|
||||
EXPECT_EQ(output, R"(---
|
||||
- block_scalac: |
|
||||
AA
|
||||
BB
|
||||
scalar: a
|
||||
...
|
||||
)");
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Test flow sequences
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user