Skip to content

Commit

Permalink
Adjust test to expect variable whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov committed Apr 12, 2024
1 parent a9ba918 commit 12c5e65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/extensions/filters/common/expr/evaluator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace Common {
namespace Expr {
namespace {

using ::testing::MatchesRegex;

TEST(Evaluator, Print) {
EXPECT_EQ(print(CelValue::CreateBool(false)), "false");
EXPECT_EQ(print(CelValue::CreateInt64(123)), "123");
Expand All @@ -29,8 +31,8 @@ TEST(Evaluator, Print) {
std::string node_yaml = "id: test";
TestUtility::loadFromYaml(node_yaml, node);
EXPECT_EQ(print(CelValue::CreateNull()), "NULL");
EXPECT_EQ(print(google::api::expr::runtime::CelProtoWrapper::CreateMessage(&node, &arena)),
"id: \"test\"");
EXPECT_THAT(print(google::api::expr::runtime::CelProtoWrapper::CreateMessage(&node, &arena)),
MatchesRegex("id:\\s+\"test\""));

EXPECT_EQ(print(CelValue::CreateDuration(absl::Minutes(1))), "1m");
absl::Time time = TestUtility::parseTime("Dec 22 01:50:34 2020 GMT", "%b %e %H:%M:%S %Y GMT");
Expand Down

0 comments on commit 12c5e65

Please sign in to comment.