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

LongestRepeatedSubstringSearchUnitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_lrs() 0 4 1
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()