leetcode/tests/s0018_4sum.cpp
Sainnhe Park 1de1398897
All checks were successful
continuous-integration/drone/push Build is passing
s0018
2022-11-04 16:35:55 +08:00

20 lines
473 B
C++

#include "s0018_4sum.hpp"
#include <gtest/gtest.h>
TEST(Problem18, Case1) {
vector<int> nums{1, 0, -1, 0, -2, 2};
int target{0};
vector<vector<int>> sum{{-2, -1, 1, 2}, {-2, 0, 0, 2}, {-1, 0, 0, 1}};
Solution solution;
EXPECT_EQ(solution.fourSum(nums, target), sum);
}
TEST(Problem18, Case2) {
vector<int> nums{2, 2, 2, 2, 2};
int target{8};
vector<vector<int>> sum{{2, 2, 2, 2}};
Solution solution;
EXPECT_EQ(solution.fourSum(nums, target), sum);
}