leetcode/tests/s0016_3sum_closest.cpp

20 lines
385 B
C++
Raw Normal View History

2022-11-04 07:03:06 +00:00
#include "s0016_3sum_closest.hpp"
#include <gtest/gtest.h>
TEST(Problem16, Case1) {
vector<int> nums{-1, 2, 1, -4};
int target{1};
int o{2};
2022-11-30 10:20:36 +00:00
S0016 solution;
2022-11-04 07:03:06 +00:00
EXPECT_EQ(solution.threeSumClosest(nums, target), o);
}
TEST(Problem16, Case2) {
vector<int> nums{0, 0, 0};
int target{1};
int o{0};
2022-11-30 10:20:36 +00:00
S0016 solution;
2022-11-04 07:03:06 +00:00
EXPECT_EQ(solution.threeSumClosest(nums, target), o);
}