Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "gtest/gtest.h"
- #include "funcs.h"
- TEST(find_and_cut, partial_cut) {
- const std::string line = "hasudhasu";
- const std::string word = "a";
- ASSERT_STREQ(
- find_and_cut(line, word).c_str(),
- "hsudhsu"
- ) << "find_and_cut() doesn't seems to work";
- }
- TEST(find_and_cut, full_cut) {
- const std::string line = "hasudhasu";
- const std::string word = "hasudhasu";
- ASSERT_STREQ(
- find_and_cut(line, word).c_str(),
- ""
- ) << "find_and_cut() doesn't seems to work with full cut";
- }
- TEST(find_and_cut, no_cut) {
- const std::string line = "hasudhasu";
- const std::string word = "";
- ASSERT_STREQ(
- find_and_cut(line, word).c_str(),
- "hasudhasu"
- ) << "find_and_cut() doesn't seems to work with no cut";
- }
- TEST(lower, equal) {
- const std::string word = "ADASDasdqw";
- ASSERT_STREQ(
- lower(word).c_str(),
- "adasdasdqw"
- ) << "lower() doesn't seems to work";
- }
- TEST(sorting, normal) {
- std::vector<std::string> vs_test = {
- "Asd",
- "Cwe",
- "Ber"
- };
- vs_test = sort_ignorcase(vs_test);
- ASSERT_STREQ(
- vs_test[0].c_str(),
- "Asd"
- );
- ASSERT_STREQ(
- vs_test[1].c_str(),
- "Cwe"
- );
- ASSERT_STREQ(
- vs_test[2].c_str(),
- "Ber"
- );
- }
- TEST(sorting, ignorcase) {
- std::vector<std::string> vs_test = {
- "Asd",
- "abe",
- "Ber"
- };
- vs_test = sort_ignorcase(vs_test);
- ASSERT_STREQ(
- vs_test[0].c_str(),
- "abe"
- );
- ASSERT_STREQ(
- vs_test[1].c_str(),
- "Asd"
- );
- ASSERT_STREQ(
- vs_test[2].c_str(),
- "Ber"
- );
- }
- int main(int argc, char** argv)
- {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement