Passed
Push — master ( f0fa5b...9f7531 )
by Xianshun
01:21
created

LongestRepeatedSubstringSearchUnitTest.test_lrs()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
import unittest
2
3
from pyalgs.algorithms.strings.longest_repeated_substring import LongestRepeatedSubstringSearch
4
5
6
class LongestRepeatedSubstringSearchUnitTest(unittest.TestCase):
7
8
    def test_lrs(self):
9
        start, len = LongestRepeatedSubstringSearch.lrs('Hello World', 'World Record')
10
        print('Hello World'[start:(start+len+1)])
11
        self.assertEqual('World', 'Hello World'[start:(start+len+1)])
12
13
14
if __name__ == '__main__':
15
    unittest.main()