Skip to content

Commit 291f7b1

Browse files
committed
Apply JS standard rules on KMPPatternSearching.js
1 parent 2c5aaa3 commit 291f7b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

String/test/KMPPatternSearching.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ describe('KMP Matcher', () => {
1212
const pattern = 'ABCDABD'
1313
expect(KMPSearch(text, pattern)).toStrictEqual([4, 16])
1414
})
15+
16+
it('TC3: expects to return matching indices for pattern in text', () => {
17+
const text = 'AAAAA'
18+
const pattern = 'AAA'
19+
expect(KMPSearch(text, pattern)).toStrictEqual([0, 1, 2])
20+
})
21+
22+
it('TC4: expects to return matching indices for pattern in text', () => {
23+
const text = 'ABCD'
24+
const pattern = 'BA'
25+
expect(KMPSearch(text, pattern)).toStrictEqual([])
26+
})
1527
})

0 commit comments

Comments
 (0)