leetcode/tests/s0030_substring_with_concatenation_of_all_words.cpp

20 lines
488 B
C++
Raw Normal View History

2022-11-16 02:58:20 +00:00
#include "s0030_substring_with_concatenation_of_all_words.hpp"
#include <gtest/gtest.h>
TEST(Problem30, Case1) {
string s{"barfoothefoobarman"};
vector<string> words{"foo", "bar"};
vector<int> o{0, 9};
2022-11-30 10:20:36 +00:00
S0030 solution;
2022-11-16 02:58:20 +00:00
EXPECT_EQ(solution.findSubstring(s, words), o);
}
TEST(Problem30, Case2) {
string s{"wordgoodgoodgoodbestword"};
vector<string> words{"word","good","best","word"};
vector<int> o{};
2022-11-30 10:20:36 +00:00
S0030 solution;
2022-11-16 02:58:20 +00:00
EXPECT_EQ(solution.findSubstring(s, words), o);
}