1 //===- YAMLTest.cpp - Tests for Object YAML -------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/ObjectYAML/YAML.h"
10 #include "llvm/Support/YAMLTraits.h"
11 #include "gtest/gtest.h"
16 yaml::BinaryRef Binary
;
22 struct MappingTraits
<BinaryHolder
> {
23 static void mapping(IO
&IO
, BinaryHolder
&BH
) {
24 IO
.mapRequired("Binary", BH
.Binary
);
27 } // end namespace yaml
28 } // end namespace llvm
30 TEST(ObjectYAML
, BinaryRef
) {
32 SmallVector
<char, 32> Buf
;
33 llvm::raw_svector_ostream
OS(Buf
);
34 yaml::Output
YOut(OS
);
36 EXPECT_NE(OS
.str().find("''"), StringRef::npos
);