18d8129b99
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
23 lines
529 B
C++
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}));
|
|
}
|