Skip to content

Commit 109f32d

Browse files
committed
test: cover missed code branches.
1 parent 1cdd39f commit 109f32d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sorts/test/IntroSort.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { introsort } from '../IntroSort'
33
describe('introsort', () => {
44
it('should have a robust default comparator', () => {
55
// toString, null, undefined
6-
const mixedData = [undefined, '2', 1, false, null]
6+
const mixedData = [undefined, '2', 1, false, null, { a: 7 }]
77
introsort(mixedData)
8-
expect(mixedData).toEqual([1, '2', false, null, undefined])
8+
expect(mixedData).toEqual([1, '2', { a: 7 }, false, null, undefined])
99

1010
// Symbol
1111
expect(() => introsort([Symbol(), Symbol()])).toThrowError()
@@ -14,6 +14,7 @@ describe('introsort', () => {
1414
it('fails gracefully', () => {
1515
introsort('string')
1616
introsort([])
17+
introsort(['one len'])
1718
introsort([1, 2, 3], 'string')
1819
})
1920

0 commit comments

Comments
 (0)