[PATCH] D117626: [ADT] [NFC] Add StringRef::detectEOL

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 20 19:17:15 PST 2022


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Sounds good to me



================
Comment at: llvm/unittests/ADT/StringRefTest.cpp:1114-1116
+  for (const auto &Entry : Cases) {
+    EXPECT_EQ(StringRef("\n"), Entry.detectEOL());
+  }
----------------
Usually skip braces on single line blocks.

Might be marginally better to write these out without the loop, though - I realize it's some duplication (though currently it's fewer lines anyway). Makes for clearer error messages from gunit because the line of code is unambiguous about what's being tested rather than having to map it up through the array, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117626/new/

https://reviews.llvm.org/D117626



More information about the cfe-commits mailing list