Skip to content

Commit e7165d6

Browse files
committed
Add tests to the newly added add_unique_items method
1 parent 5be6ffe commit e7165d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hardware_interface/test/test_helpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ TEST(TestHelper, test_helper_methods)
7878
ASSERT_FALSE(ros2_control::has_no_common_items(set2, set2));
7979
ASSERT_FALSE(ros2_control::has_no_common_items(vec1, set3));
8080
ASSERT_FALSE(ros2_control::has_no_common_items(set1, vec3));
81+
82+
std::vector<std::string> vec4 = vec3;
83+
ASSERT_THAT(vec4, ::testing::ElementsAre("aa", "bb", "dd"));
84+
ros2_control::add_unique_items(vec4, vec2);
85+
ASSERT_THAT(vec4, ::testing::ElementsAre("aa", "bb", "dd", "ee"));
8186
}

0 commit comments

Comments
 (0)