48
|
1 #!/usr/bin/env python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 """
|
|
5 unit tests for `textshaper.split`
|
|
6 """
|
|
7
|
|
8 # imports
|
|
9 import unittest
|
|
10 from textshaper import split
|
|
11
|
|
12
|
|
13 class SplitUnitTest(unittest.TestCase):
|
|
14
|
|
15 def test_findall(self):
|
|
16 """test basic"""
|
|
17
|
49
|
18 # 012345678901
|
|
19 string = 'a cat, a bat'
|
48
|
20
|
49
|
21 retval = split.findall(string, 'a')
|
50
|
22 self.assertEqual(retval, [0,3,7,10])
|
|
23
|
|
24 self.assertEqual(split.findall(string, 't'),
|
|
25 [4, 11])
|
|
26
|
|
27
|
48
|
28 if __name__ == '__main__':
|
|
29 unittest.main()
|
|
30
|