[PATCH] D158925: [clang-format][NFC] Skip stability test if input is pre-formatted
Owen Pan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 26 14:48:52 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc8521451708a: [clang-format][NFC] Skip stability test if input is pre-formatted (authored by owenpan).
Changed prior to commit:
https://reviews.llvm.org/D158925?vs=553714&id=553765#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158925/new/
https://reviews.llvm.org/D158925
Files:
clang/unittests/Format/FormatTestBase.h
Index: clang/unittests/Format/FormatTestBase.h
===================================================================
--- clang/unittests/Format/FormatTestBase.h
+++ clang/unittests/Format/FormatTestBase.h
@@ -85,9 +85,11 @@
const std::optional<FormatStyle> &Style = {},
const std::vector<tooling::Range> &Ranges = {}) {
testing::ScopedTrace t(File, Line, ::testing::Message() << Code.str());
- EXPECT_EQ(Expected.str(),
- format(Expected, Style, SC_ExpectComplete, Ranges))
- << "Expected code is not stable";
+ if (Expected != Code) {
+ EXPECT_EQ(Expected.str(),
+ format(Expected, Style, SC_ExpectComplete, Ranges))
+ << "Expected code is not stable";
+ }
EXPECT_EQ(Expected.str(), format(Code, Style, SC_ExpectComplete, Ranges));
auto UsedStyle = Style ? Style.value() : getDefaultStyle();
if (UsedStyle.Language == FormatStyle::LK_Cpp) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158925.553765.patch
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230826/6bad09b3/attachment.bin>
More information about the cfe-commits
mailing list