[clang] 311a00c - [clang-format] Clean up DefinitionBlockSeparatorTest. NFC.
Marek Kurdej via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 25 03:00:17 PDT 2022
Author: Marek Kurdej
Date: 2022-03-25T10:59:46+01:00
New Revision: 311a00c39046ed3f84cd31ffcd513975d3000402
URL: https://github.com/llvm/llvm-project/commit/311a00c39046ed3f84cd31ffcd513975d3000402
DIFF: https://github.com/llvm/llvm-project/commit/311a00c39046ed3f84cd31ffcd513975d3000402.diff
LOG: [clang-format] Clean up DefinitionBlockSeparatorTest. NFC.
Added:
Modified:
clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp b/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
index 582b62e445df9..53a3c57ad59fa 100644
--- a/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
+++ b/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
@@ -56,17 +56,15 @@ class DefinitionBlockSeparatorTest : public ::testing::Test {
InverseStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Never;
else
InverseStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Always;
- EXPECT_EQ(ExpectedCode.str(), separateDefinitionBlocks(ExpectedCode, Style))
+ EXPECT_EQ(ExpectedCode, separateDefinitionBlocks(ExpectedCode, Style))
<< "Expected code is not stable";
- std::string InverseResult =
- separateDefinitionBlocks(ExpectedCode, InverseStyle);
- EXPECT_NE(ExpectedCode.str(), InverseResult)
+ EXPECT_NE(ExpectedCode,
+ separateDefinitionBlocks(ExpectedCode, InverseStyle))
<< "Inverse formatting makes no
diff erence";
std::string CodeToFormat =
HasOriginalCode ? Code.str() : removeEmptyLines(Code);
std::string Result = separateDefinitionBlocks(CodeToFormat, Style);
- EXPECT_EQ(ExpectedCode.str(), Result) << "Test failed. Formatted:\n"
- << Result;
+ EXPECT_EQ(ExpectedCode, Result) << "Test failed. Formatted:\n" << Result;
}
static std::string removeEmptyLines(llvm::StringRef Code) {
More information about the cfe-commits
mailing list