s0007
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-11-02 21:34:49 +08:00
parent 83c66fc158
commit 59d1cb7245
3 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include "s0007_reverse_integer.hpp"
#include <gtest/gtest.h>
TEST(Problem7, Case1) {
int i = 123;
int o = 321;
Solution solution;
EXPECT_EQ(solution.reverse(i), o);
}
TEST(Problem7, Case2) {
int i = -123;
int o = -321;
Solution solution;
EXPECT_EQ(solution.reverse(i), o);
}
TEST(Problem7, Case3) {
int i = 120;
int o = 21;
Solution solution;
EXPECT_EQ(solution.reverse(i), o);
}
TEST(Problem7, Case4) {
int i = -2147483648;
int o = 0;
Solution solution;
EXPECT_EQ(solution.reverse(i), o);
}