s0033
This commit is contained in:
27
tests/s0033_search_in_rotated_sorted_array.cpp
Normal file
27
tests/s0033_search_in_rotated_sorted_array.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#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};
|
||||
Solution 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};
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.search(nums, target), o);
|
||||
}
|
||||
|
||||
TEST(Problem33, Case3) {
|
||||
vector<int> nums{1};
|
||||
int target{0};
|
||||
int o{-1};
|
||||
Solution solution;
|
||||
EXPECT_EQ(solution.search(nums, target), o);
|
||||
}
|
Reference in New Issue
Block a user