Skip to content

Commit d35001a

Browse files
committed
test: add missing test cases
1 parent d1bbbf1 commit d35001a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

math/ncr_modulo_p.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ static void tests() {
150150
};
151151
const std::vector<TestCase> test_cases = {
152152
TestCase(60000, 1000000007, 52323, 26161, 224944353),
153-
TestCase(20, 5, 6, 2, 30 % 5), TestCase(100, 29, 7, 3, 35 % 29),
154-
TestCase(1000, 13, 10, 3, 120 % 13)};
153+
TestCase(20, 5, 6, 2, 30 % 5),
154+
TestCase(100, 29, 7, 3, 35 % 29),
155+
TestCase(1000, 13, 10, 3, 120 % 13),
156+
TestCase(20, 17, 1, 10, 0),
157+
TestCase(45, 19, 23, 1, 23 % 19),
158+
TestCase(45, 19, 23, 0, 1),
159+
TestCase(45, 19, 23, 23, 1)};
155160
for (const auto& tc : test_cases) {
156161
assert(math::ncr_modulo_p::NCRModuloP(tc.size, tc.p).ncr(tc.n, tc.r) ==
157162
tc.expected);

0 commit comments

Comments
 (0)