From 6205a9c8b43f6eef13d70184015549933157ab35 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Thu, 24 Oct 2024 01:06:59 -0700 Subject: [PATCH] avoid matching string_view in RegexMatchCache tests Summary: The gtest `Matcher` class is specialized for `string_view`, but only if it is built with knowledge of `string_view`. Allow building the test without requiring gtest to have knowledge of `string_view`. Reviewed By: mdas7 Differential Revision: D64812801 fbshipit-source-id: 68eab061b53bbb9b555fd942bf1a88e9c303a27a --- folly/container/test/RegexMatchCacheTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/folly/container/test/RegexMatchCacheTest.cpp b/folly/container/test/RegexMatchCacheTest.cpp index a7739d29429..eefa266ebdb 100644 --- a/folly/container/test/RegexMatchCacheTest.cpp +++ b/folly/container/test/RegexMatchCacheTest.cpp @@ -365,7 +365,11 @@ struct RegexMatchCacheTest : testing::Test { } auto getRegexList(RegexMatchCache const& cache) const { - return cache.getRegexList(keys); + std::vector ret; + for (auto const item : cache.getRegexList(keys)) { + ret.emplace_back(item); + } + return ret; } auto lookup(RegexMatchCache& cache, std::string_view regex, time_point now) {