Files
JavaScript/Dynamic-Programming/Sliding-Window/test/LongestSubstringWithoutRepeatingCharacters.test.js
Aditya Parmar 308b022b03 merge: Sliding window (#833)
* new algorithm 'Sliding-Window' added with example 'Longest Substring Without Repeating Characters'

* new example of sliding window 'Permutation in String' added

* chore: add `ignore_words_list`

* sliding-window moved into Dynamic-programming directory

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-11-03 09:33:20 +05:30

12 lines
629 B
JavaScript

import { LongestSubstringWithoutRepeatingCharacters } from '../LongestSubstringWithoutRepeatingCharacters.js'
describe('LongestSubstringWithoutRepeatingCharacters', () => {
it('should return longest substring without repeating characters', () => {
expect(LongestSubstringWithoutRepeatingCharacters('abcabcbb')).toEqual(3)
expect(LongestSubstringWithoutRepeatingCharacters('bbbbb')).toEqual(1)
expect(LongestSubstringWithoutRepeatingCharacters('pwwkew')).toEqual(3)
expect(LongestSubstringWithoutRepeatingCharacters('a')).toEqual(1)
expect(LongestSubstringWithoutRepeatingCharacters('')).toEqual(0)
})
})