From eed6e610d624780b199aad108697469e49cc39f0 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 17 Feb 2022 11:07:26 -0800 Subject: [PATCH] Implement assert_equal_vector_char_pointer using gtest matcher. This makes the failure output richer. Closes #14036. PiperOrigin-RevId: 429354001 --- src/test/cpp/blaze_util_test.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/test/cpp/blaze_util_test.cc b/src/test/cpp/blaze_util_test.cc index 6bf539c23237f9..9ca7eb4e7ae94b 100644 --- a/src/test/cpp/blaze_util_test.cc +++ b/src/test/cpp/blaze_util_test.cc @@ -236,13 +236,7 @@ TEST_F(BlazeUtilTest, TestSearchUnaryCommandOptionWarnsAboutDuplicates) { void assert_equal_vector_char_pointer(std::vector expected, std::vector actual) { - ASSERT_EQ(actual.size(), expected.size()) - << "Vectors expected and actual are of unequal length"; - - for (int i = 0; i < actual.size(); ++i) { - ASSERT_EQ(actual[i], expected[i]) - << "Vectors expected and actual differ at index " << i; - } + ASSERT_THAT(actual, testing::ContainerEq(expected)); } TEST_F(BlazeUtilTest, TestSearchAllUnaryForEmpty) {