memgraph/tests/unit/utils_algorithm.cpp
Marin Tomic 18d8129b99 Implement string functions
Summary:
Added missing string functions.
I also cleaned up error messages a bit in effort to make them uniform.

Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1458
2018-07-02 10:39:11 +02:00

23 lines
529 B
C++

#include <list>
#include <string>
#include <vector>
#include "gtest/gtest.h"
#include "utils/algorithm.hpp"
using vec = std::vector<std::string>;
using namespace std::string_literals;
using namespace utils;
TEST(Algorithm, Reversed) {
EXPECT_EQ(Reversed(""s), ""s);
EXPECT_EQ(Reversed("abc"s), "cba"s);
EXPECT_EQ(Reversed(std::vector<int>({1, 2, 3, 4})),
std::vector<int>({4, 3, 2, 1}));
EXPECT_EQ(Reversed(std::list<std::string>({"ab"s, "cd"s})),
std::list<std::string>({"cd"s, "ab"s}));
}