[PATCH] D66520: [gtest] Fix printing of StringRef and SmallString in assert messages.
    James Henderson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Aug 21 03:54:12 PDT 2019
    
    
  
jhenderson added inline comments.
================
Comment at: llvm/unittests/ADT/SmallStringTest.cpp:206
 
+// Check gtest prints SmallString as string instead of a container of chars.
+// The code is in utils/unittest/googletest/internal/custom/gtest-printers.h
----------------
as a string
================
Comment at: llvm/unittests/ADT/SmallStringTest.cpp:209
+TEST_F(SmallStringTest, GTestPrinter) {
+  EXPECT_EQ(R"("foo")", ::testing::PrintToString(SmallString<1>("foo")));
+  const SmallVectorImpl<char> &ErasedSmallString = SmallString<1>("foo");
----------------
Do you really need the R"" syntax for the string here? It seems a bit unnecessary when "foo" should suffice.
================
Comment at: llvm/unittests/ADT/StringRefTest.cpp:1058
 
+// Check gtest prints StringRef as string instead of a container of chars.
+// The code is in utils/unittest/googletest/internal/custom/gtest-printers.h
----------------
as a string
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66520/new/
https://reviews.llvm.org/D66520
    
    
More information about the llvm-commits
mailing list