leetcode/tests/s0033_search_in_rotated_sor...

28 lines
551 B
C++

#include "s0033_search_in_rotated_sorted_array.hpp"
#include <gtest/gtest.h>
TEST(Problem33, Case1) {
vector<int> nums{4, 5, 6, 7, 0, 1, 2};
int target{0};
int o{4};
S0033 solution;
EXPECT_EQ(solution.search(nums, target), o);
}
TEST(Problem33, Case2) {
vector<int> nums{4, 5, 6, 7, 0, 1, 2};
int target{3};
int o{-1};
S0033 solution;
EXPECT_EQ(solution.search(nums, target), o);
}
TEST(Problem33, Case3) {
vector<int> nums{1};
int target{0};
int o{-1};
S0033 solution;
EXPECT_EQ(solution.search(nums, target), o);
}