diff options
author | Nick Kledzik <kledzik@apple.com> | 2013-01-04 19:32:00 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2013-01-04 19:32:00 +0000 |
commit | 50c30427405142f1b587edee846606184ae6af8e (patch) | |
tree | d54ca0e131c2122dfe5a9d6f2eb850229ffd1e91 /unittests/Support | |
parent | f53b78f5bf28dff9536687245239f6aa200add86 (diff) |
Fix how YAML I/O detects flow sequences.
Update test case to verify flow sequence is
written as a flow sequence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-rw-r--r-- | unittests/Support/YAMLIOTest.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index fab2d5b666..afa71cc25e 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -600,8 +600,14 @@ TEST(YAMLIO, TestReadWriteMyFlowSequence) { map.numbers.push_back(1024); llvm::raw_string_ostream ostr(intermediate); - Output yout(ostr); + Output yout(ostr); yout << map; + + // Verify sequences were written in flow style + ostr.flush(); + llvm::StringRef flowOut(intermediate); + EXPECT_NE(llvm::StringRef::npos, flowOut.find("one, two")); + EXPECT_NE(llvm::StringRef::npos, flowOut.find("10, -30, 1024")); } { @@ -632,7 +638,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint32_t, TotalSeconds) typedef std::vector<TotalSeconds> SecondsSequence; -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(TotalSeconds) +LLVM_YAML_IS_SEQUENCE_VECTOR(TotalSeconds) namespace llvm { @@ -745,7 +751,7 @@ struct KindAndFlags { typedef std::vector<KindAndFlags> KindAndFlagsSequence; -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(KindAndFlags) +LLVM_YAML_IS_SEQUENCE_VECTOR(KindAndFlags) namespace llvm { namespace yaml { |