2020-07-04 10:56:49 -04:00
|
|
|
import unittest
|
2015-12-19 02:15:14 +05:30
|
|
|
|
|
|
|
|
2020-07-04 10:56:49 -04:00
|
|
|
class TestCompress(unittest.TestCase):
|
2015-12-19 02:15:14 +05:30
|
|
|
|
|
|
|
def test_compress(self, func):
|
2020-07-04 10:56:49 -04:00
|
|
|
self.assertEqual(func(None), None)
|
|
|
|
self.assertEqual(func(''), '')
|
|
|
|
self.assertEqual(func('AABBCC'), 'AABBCC')
|
|
|
|
self.assertEqual(func('AAABCCDDDD'), 'A3BCCD4')
|
|
|
|
self.assertEqual(
|
|
|
|
func('aaBCCEFFFFKKMMMMMMP taaammanlaarrrr seeeeeeeeek tooo'),
|
|
|
|
'aaBCCEF4KKM6P ta3mmanlaar4 se9k to3',
|
|
|
|
)
|
2015-12-19 02:15:14 +05:30
|
|
|
print('Success: test_compress')
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
test = TestCompress()
|
|
|
|
test.test_compress(compress_string)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2020-07-04 10:56:49 -04:00
|
|
|
main()
|