#include "absl/strings/has_absl_stringify.h"
#include <string>
#include "gtest/gtest.h"
#include "absl/types/optional.h"
namespace {
struct TypeWithoutAbslStringify {};
struct TypeWithAbslStringify {
template <typename Sink>
friend void AbslStringify(Sink&, const TypeWithAbslStringify&) {}
};
TEST(HasAbslStringifyTest, Works) {
EXPECT_FALSE(absl::HasAbslStringify<int>::value);
EXPECT_FALSE(absl::HasAbslStringify<std::string>::value);
EXPECT_FALSE(absl::HasAbslStringify<TypeWithoutAbslStringify>::value);
EXPECT_TRUE(absl::HasAbslStringify<TypeWithAbslStringify>::value);
EXPECT_FALSE(
absl::HasAbslStringify<absl::optional<TypeWithAbslStringify>>::value);
}
}