|
| 1 | +import { test, expectTypeOf, expect, describe } from 'vitest' |
| 2 | +import { getIndexsForPalindrome } from '../challenges/11' |
| 3 | + |
| 4 | +describe('Challenge #11', () => { |
| 5 | + // test('Test #01', () => { |
| 6 | + // expectTypeOf(getIndexsForPalindrome).returns.toEqualTypeOf(typeForGetIndexsForPalindrome) |
| 7 | + // }) |
| 8 | + |
| 9 | + // Test: getIndexsForPalindrome('anna') |
| 10 | + test('Test #02', () => { |
| 11 | + expect(getIndexsForPalindrome('anna')).toEqual([]) |
| 12 | + }) |
| 13 | + |
| 14 | + // Test: getIndexsForPalindrome('abab') |
| 15 | + test('Test #03', () => { |
| 16 | + expect(getIndexsForPalindrome('abab')).toEqual([0, 1]) |
| 17 | + }) |
| 18 | + |
| 19 | + // Test: getIndexsForPalindrome('abac') |
| 20 | + test('Test #04', () => { |
| 21 | + expect(getIndexsForPalindrome('abac')).toEqual(null) |
| 22 | + }) |
| 23 | + |
| 24 | + // Test: getIndexsForPalindrome('aaaaaaaa') |
| 25 | + test('Test #05', () => { |
| 26 | + expect(getIndexsForPalindrome('aaaaaaaa')).toEqual([]) |
| 27 | + }) |
| 28 | + |
| 29 | + // Test: getIndexsForPalindrome('aaababa') |
| 30 | + test('Test #06', () => { |
| 31 | + expect(getIndexsForPalindrome('aaababa')).toEqual([1, 3]) |
| 32 | + }) |
| 33 | + |
| 34 | + // Test: getIndexsForPalindrome('caababa') |
| 35 | + test('Test #07', () => { |
| 36 | + expect(getIndexsForPalindrome('caababa')).toEqual(null) |
| 37 | + }) |
| 38 | + |
| 39 | + // Test: getIndexsForPalindrome('rotavator') |
| 40 | + test('Test #08', () => { |
| 41 | + expect(getIndexsForPalindrome('rotavator')).toEqual([]) |
| 42 | + }) |
| 43 | + |
| 44 | + // Test: getIndexsForPalindrome('rotaratov') |
| 45 | + test('Test #09', () => { |
| 46 | + expect(getIndexsForPalindrome('rotaratov')).toEqual([4, 8]) |
| 47 | + }) |
| 48 | + |
| 49 | + // Test: getIndexsForPalindrome('saippuakivikauppias') |
| 50 | + test('Test #10', () => { |
| 51 | + expect(getIndexsForPalindrome('saippuakivikauppias')).toEqual([]) |
| 52 | + }) |
| 53 | +}) |
0 commit comments