labath added a comment.
I haven't looked at the code in detail, but it seems ok to me.
What does not seem ok is the hand-rolled matching in the tests. A more
idiomatic approach would be to replace `isFormatCorrect` with a wrapper
function which can be called from a test macro, and let gtest do the matching:
Say, something like this:
/// Return the formatted string, or None if formatting failed.
Optional<std::string> format(StringRef input, ...) {
...
if (success)
return out.GetString();
return None;
}
...
EXPECT_EQ(format("foo", ...), std::string("foo")); // std::string is needed
because Optional<string> and const char * are not comparable -- may want to
make an alias/lambda for that
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