/* * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include #include #include #include "osquery/core/test_util.h" namespace osquery { class TextTests : public testing::Test {}; TEST_F(TextTests, test_split) { for (const auto& i : generateSplitStringTestData()) { EXPECT_EQ(split(i.test_string), i.test_vector); } } TEST_F(TextTests, test_join) { std::vector content = { "one", "two", "three", }; EXPECT_EQ(join(content, ", "), "one, two, three"); } TEST_F(TextTests, test_split_occurences) { std::string content = "T: 'S:S'"; std::vector expected = { "T", "'S:S'", }; EXPECT_EQ(split(content, ":", 1), expected); } }