tokenizer_test.cxx 622 B

123456789101112131415161718192021222324252627
  1. //
  2. // tokenizer_test.cxx
  3. // string-utils
  4. //
  5. // Created by Sam Jaffe on 10/8/20.
  6. // Copyright © 2020 Sam Jaffe. All rights reserved.
  7. //
  8. #include "string_utils/tokenizer.h"
  9. #include <gmock/gmock.h>
  10. #include <gtest/gtest.h>
  11. using namespace string_utils;
  12. #if XCODE_UNIT_TEST
  13. // This is a hack to allow XCode to properly display failures when running
  14. // unit tests.
  15. #undef EXPECT_THAT
  16. #define EXPECT_THAT ASSERT_THAT
  17. #endif
  18. TEST(TokenizerTest, SplitsStringOverToken) {
  19. std::string const input = "A.B.C.D";
  20. std::vector<std::string> const expected{"A", "B", "C", "D"};
  21. EXPECT_THAT(split(input, "."), expected);
  22. }