20 lines
390 B
C++
20 lines
390 B
C++
#include "offer_58.hpp"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
TEST(Offer58, Case1) {
|
|
string s{"abcdefg"};
|
|
int k{2};
|
|
string expected{"cdefgab"};
|
|
Offer58 solution;
|
|
EXPECT_EQ(solution.reverseLeftWords(s, k), expected);
|
|
}
|
|
|
|
TEST(Offer58, Case2) {
|
|
string s{"lrloseumgh"};
|
|
int k{6};
|
|
string expected{"umghlrlose"};
|
|
Offer58 solution;
|
|
EXPECT_EQ(solution.reverseLeftWords(s, k), expected);
|
|
}
|