leetcode/tests/offer_58.cpp

20 lines
390 B
C++
Raw Normal View History

2022-11-30 09:24:58 +00:00
#include "offer_58.hpp"
#include <gtest/gtest.h>
TEST(Offer58, Case1) {
string s{"abcdefg"};
int k{2};
string expected{"cdefgab"};
2022-11-30 10:20:36 +00:00
Offer58 solution;
2022-11-30 09:24:58 +00:00
EXPECT_EQ(solution.reverseLeftWords(s, k), expected);
}
TEST(Offer58, Case2) {
string s{"lrloseumgh"};
int k{6};
string expected{"umghlrlose"};
2022-11-30 10:20:36 +00:00
Offer58 solution;
2022-11-30 09:24:58 +00:00
EXPECT_EQ(solution.reverseLeftWords(s, k), expected);
}