labath added a comment.
The test stuff looks good to me.
================
Comment at: lldb/unittests/DataFormatter/StringPrinterTests.cpp:109
+ EXPECT_TRUE(matches({"\0", 1}, QUOTE("")));
+ EXPECT_TRUE(matches("\a", QUOTE("\\a")));
+ EXPECT_TRUE(matches("\b", QUOTE("\\u{8}")));
----------------
vsk wrote:
> shafik wrote:
> > We have [raw string
> > literals](https://en.cppreference.com/w/cpp/language/string_literal) since
> > C++11:
> >
> > ```
> > EXPECT_TRUE(matches("\a", R"("\a")"));
> > ```
> I personally find the current version much clearer, but can change this if
> others feel strongly.
I think the raw strings are cleaner, particularly when it comes to strings like
`"\\\""` and `"\\\\"`
================
Comment at: lldb/unittests/DataFormatter/StringPrinterTests.cpp:31
+template <StringPrinter::StringElementType elem_ty,
+ StringPrinter::EscapeStyle escape_style>
+static Optional<std::string> format(StringRef input) {
----------------
it looks like `escape_style` could be a regular argument instead of a template.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77843/new/
https://reviews.llvm.org/D77843
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits