fix:regex error in selection sort insertion sort and merge sort (#39230)
This commit is contained in:
@ -30,7 +30,7 @@ tests:
|
||||
- text: <code>insertionSort</code> should return an array that is unchanged except for order.
|
||||
testString: assert.sameMembers(insertionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
|
||||
- text: <code>insertionSort</code> should not use the built-in <code>.sort()</code> method.
|
||||
testString: assert(!code.match(/\.?[\s\S]*?sort/));
|
||||
testString: assert(!code.match(/\.\s*sort\s*\(/));
|
||||
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ tests:
|
||||
- text: <code>mergeSort</code> should return an array that is unchanged except for order.
|
||||
testString: assert.sameMembers(mergeSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
|
||||
- text: <code>mergeSort</code> should not use the built-in <code>.sort()</code> method.
|
||||
testString: assert(!removeJSComments(code).match(/\.?[\s\S]*?sort\s*\(/));
|
||||
testString: assert(!removeJSComments(code).match(/\.\s*sort\s*\(/));
|
||||
|
||||
```
|
||||
|
||||
|
@ -30,7 +30,7 @@ tests:
|
||||
- text: <code>selectionSort</code> should return an array that is unchanged except for order.
|
||||
testString: assert.sameMembers(selectionSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]), [1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92]);
|
||||
- text: <code>selectionSort</code> should not use the built-in <code>.sort()</code> method.
|
||||
testString: assert(!code.match(/\.?[\s\S]*?sort/));
|
||||
testString: assert(!code.match(/\.\s*sort\s*\(/));
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user