leetcode/tests/s0459_repeated_substring_pattern.cpp

32 lines
687 B
C++

#include "s0459_repeated_substring_pattern.hpp"
#include <gtest/gtest.h>
TEST(Problem459, Case1) {
string s{"abab"};
bool expected{true};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case2) {
string s{"aba"};
bool expected{false};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case3) {
string s{"abcabcabcabc"};
bool expected{true};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case4) {
string s{"abac"};
bool expected{false};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}