Skip to content

Commit 9e84343

Browse files
committed
Added tests for math
1 parent 2c1d1eb commit 9e84343

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_math.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import unittest
2+
3+
from pygorithm.math import (
4+
lcm,
5+
sieve_of_eratosthenes)
6+
7+
class TestLCM(unittest.TestCase):
8+
def test_lcm(self):
9+
self.assertEqual(lcm.lcm([3, 12, 16]), 48)
10+
11+
class TestSieveOfEratosthenes(unittest.TestCase):
12+
def test_sieve_of_eratosthenes(self):
13+
self.assertEqual(sieve_of_eratosthenes.sieve_of_eratosthenes(10), [2, 3, 5, 7])
14+
15+
if __name__ == '__main__':
16+
unittest.main()

0 commit comments

Comments
 (0)