@@ -2,29 +2,29 @@ import { quickSort } from '../QuickSortRecursive'
2
2
3
3
describe ( 'QuickSortRecursive | Partition In Place Method' , ( ) => {
4
4
it ( 'Expectedly, throw some error if we pass a non-array input' , ( ) => {
5
- expect ( ( ) => quickSort ( 'xyz' , 0 , 2 ) ) . toThrow (
5
+ expect ( ( ) => quickSort ( 'xyz' ) ) . toThrow (
6
6
'Please input a valid list or array.'
7
7
)
8
- expect ( ( ) => quickSort ( null , 0 , 4 ) ) . toThrow (
8
+ expect ( ( ) => quickSort ( null ) ) . toThrow (
9
9
'Please input a valid list or array.'
10
10
)
11
- expect ( ( ) => quickSort ( 55 , 0 , 2 ) ) . toThrow (
11
+ expect ( ( ) => quickSort ( 55 ) ) . toThrow (
12
12
'Please input a valid list or array.'
13
13
)
14
14
} )
15
15
16
16
it ( 'Expectedly, the quickSort method will sort the unsorted list in ascending order' , ( ) => {
17
17
const unSortArray = [ 5 , 9 , 3 , 4 , 6 , 2 , 0 , 1 , 7 , 8 ]
18
18
const sortedExpectedArray = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
19
- expect ( quickSort ( unSortArray , 0 , unSortArray . length - 1 ) ) . toEqual (
19
+ expect ( quickSort ( unSortArray ) ) . toEqual (
20
20
sortedExpectedArray
21
21
)
22
22
} )
23
23
24
24
it ( 'Expectedly, the quickSort method will arrange the list of character values in dictionary order.' , ( ) => {
25
25
const unSortList = [ 'd' , 'e' , 'c' , 'a' , 'f' , 'b' ]
26
26
const sortedExpectedList = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' ]
27
- expect ( quickSort ( unSortList , 0 , unSortList . length - 1 ) ) . toEqual (
27
+ expect ( quickSort ( unSortList ) ) . toEqual (
28
28
sortedExpectedList
29
29
)
30
30
} )
0 commit comments