diff options
Diffstat (limited to 'unittests/Utility/ErrorTest.cpp')
-rw-r--r-- | unittests/Utility/ErrorTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/unittests/Utility/ErrorTest.cpp b/unittests/Utility/ErrorTest.cpp new file mode 100644 index 000000000000..a114b26ebe54 --- /dev/null +++ b/unittests/Utility/ErrorTest.cpp @@ -0,0 +1,19 @@ +//===-- ErrorTest.cpp -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Utility/Error.h" +#include "gtest/gtest.h" + +using namespace lldb_private; + +TEST(ErrorTest, Formatv) { + EXPECT_EQ("", llvm::formatv("{0}", Error()).str()); + EXPECT_EQ("Hello Error", llvm::formatv("{0}", Error("Hello Error")).str()); + EXPECT_EQ("Hello", llvm::formatv("{0:5}", Error("Hello Error")).str()); +} |