Skip to content

Commit

Permalink
Implement assert_equal_vector_char_pointer using gtest matcher.
Browse files Browse the repository at this point in the history
This makes the failure output richer.

Closes bazelbuild#14036.

PiperOrigin-RevId: 429354001
  • Loading branch information
benjaminp authored and copybara-github committed Feb 17, 2022
1 parent f457d81 commit eed6e61
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/test/cpp/blaze_util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,7 @@ TEST_F(BlazeUtilTest, TestSearchUnaryCommandOptionWarnsAboutDuplicates) {

void assert_equal_vector_char_pointer(std::vector<std::string> expected,
std::vector<std::string> 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) {
Expand Down

0 comments on commit eed6e61

Please sign in to comment.