blob: bab14c96bffbdff525a414f83c127f7a83cb9746 [file] [log] [blame]
Ed Tanous50ebd4a2023-01-19 19:03:17 -08001#include "str_utility.hpp"
2
3#include <string>
4#include <vector>
5
6#include <gmock/gmock.h> // IWYU pragma: keep
7#include <gtest/gtest.h> // IWYU pragma: keep
8
9// IWYU pragma: no_include <gtest/gtest-message.h>
10// IWYU pragma: no_include <gtest/gtest-test-part.h>
11// IWYU pragma: no_include "gtest/gtest_pred_impl.h"
12// IWYU pragma: no_include <gmock/gmock-matchers.h>
13
14namespace
15{
16
17using ::testing::ElementsAre;
18using ::testing::IsEmpty;
19
20TEST(Split, PositiveTests)
21{
22 using bmcweb::split;
23 std::vector<std::string> vec;
24 split(vec, "xx-abc-xx-abb", '-');
25 EXPECT_THAT(vec, ElementsAre("xx", "abc", "xx", "abb"));
26 vec.clear();
27 split(vec, "", '-');
28 EXPECT_THAT(vec, IsEmpty());
29}
30
31} // namespace