Merge pull request #4567 from bartvde/issue-4566
Always pass on a compare function to sort
This commit is contained in:
committed by
Bart van den Eijnden
parent
5d64762bcb
commit
4b7e8f5f83
@@ -2,6 +2,16 @@ goog.provide('ol.test.array');
|
||||
|
||||
describe('ol.array', function() {
|
||||
|
||||
describe('defaultCompare', function() {
|
||||
it('sorts as expected', function() {
|
||||
var arr = [40, 200, 3000];
|
||||
var expected = [40, 200, 3000];
|
||||
// default sort would yield [200, 3000, 40]
|
||||
arr.sort(ol.array.defaultCompare);
|
||||
expect(arr).to.eql(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('binaryFindNearest', function() {
|
||||
it('returns expected value', function() {
|
||||
var arr = [1000, 500, 100];
|
||||
|
||||
Reference in New Issue
Block a user