smbinterp/test/pattern.py
Stephen Mardson McQuay 9827035e72 made it so I can call all tests at once
--HG--
rename : test/2dcubic.py => test/cubic2d.py
rename : test/2dquadratic.py => test/quadratic2d.py
2011-02-15 11:27:45 -07:00

53 lines
1.3 KiB
Python

#!/usr/bin/env python
import unittest
from interp.baker import pattern
class Test(unittest.TestCase):
def setUp(self):
pass
def testImports(self):
from interp.baker import pattern
def test_baker_eq_8(self):
b = sorted([tuple(sorted(i)) for i in ((1,2),(2,3),(3,1))])
p = sorted(pattern(power = 2, phicount = 3))
self.assertEqual(b,p)
def test_baker_eq_17(self):
b = sorted([tuple(sorted(i)) for i in ((1,2,2), (1,3,3), (2,1,1), (2,3,3), (3,1,1), (3,2,2), (1,2,3))])
p = sorted(pattern(power = 3, phicount = 3))
self.assertEqual(b,p)
def test_baker_eq_15(self):
b = sorted([tuple(sorted(i)) for i in (
(1,2), (1,3), (1,4),
(2,3), (2,4), (3,4))])
p = sorted(pattern(power = 2, phicount = 4))
self.assertEqual(b,p)
def test_smcquay_(self):
b = sorted([tuple(sorted(i)) for i in (
(1,2,3), (2,3,4), (1,2,4), (1,3,4),
(1,1,2), (1,2,2),
(2,3,3), (2,2,3),
(1,3,3), (1,1,3),
(2,4,4), (2,2,4),
(3,3,4), (3,4,4),
(1,4,4), (1,1,4))])
p = sorted(pattern(power = 3, phicount = 4))
self.assertEqual(b,p)
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(Test)
unittest.TextTestRunner(verbosity=3).run(suite)