Skip to content

Commit

Permalink
Apply JS standard rules on KMPPatternSearching.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul1995 committed Oct 30, 2020
1 parent 2c5aaa3 commit 291f7b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions String/test/KMPPatternSearching.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@ describe('KMP Matcher', () => {
const pattern = 'ABCDABD'
expect(KMPSearch(text, pattern)).toStrictEqual([4, 16])
})

it('TC3: expects to return matching indices for pattern in text', () => {
const text = 'AAAAA'
const pattern = 'AAA'
expect(KMPSearch(text, pattern)).toStrictEqual([0, 1, 2])
})

it('TC4: expects to return matching indices for pattern in text', () => {
const text = 'ABCD'
const pattern = 'BA'
expect(KMPSearch(text, pattern)).toStrictEqual([])
})
})

0 comments on commit 291f7b1

Please sign in to comment.