pull/37014/head
Craig Tiller 5 months ago
parent 57890df579
commit 8194ca3ea8
  1. 2
      src/core/lib/promise/status_flag.h
  2. 5
      test/core/promise/status_flag_test.cc

@ -263,7 +263,7 @@ class ValueOrFailure {
friend void AbslStringify(Sink& sink, const ValueOrFailure& value) {
if (value.ok()) {
sink.Append("Success(");
sink.Append(absl::StrCat(value));
sink.Append(absl::StrCat(*value));
sink.Append(")");
} else {
sink.Append("Failure");

@ -38,6 +38,11 @@ TEST(StatusFlagTest, Basics) {
EXPECT_FALSE(IsStatusOk(Failure{}));
}
TEST(StatusFlagTest, StringifyValueOrFailure) {
EXPECT_EQ(absl::StrCat(ValueOrFailure<int>(42)), "Success(42)");
EXPECT_EQ(absl::StrCat(ValueOrFailure<int>(Failure{})), "Failure");
}
} // namespace grpc_core
int main(int argc, char** argv) {

Loading…
Cancel
Save