Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for tightened sortedIndex specification

Test that the lowest index, rather than any index, at which the element
should be inserted to maintain sorted order is returned.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information...
commit 1aaeb4127ca498fc12e126f94022744a8e4301e5 1 parent 06c773b
@kevinoid kevinoid authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  test/collections.js
View
3  test/collections.js
@@ -260,6 +260,9 @@ $(document).ready(function() {
var numbers = [10, 20, 30, 40, 50], num = 35;
var index = _.sortedIndex(numbers, num);
equal(index, 3, '35 should be inserted at index 3');
+
+ var index2 = _.sortedIndex(numbers, 30);
+ equal(index2, 2, '30 should be inserted at index 2');
});
test('collections: shuffle', function() {
Please sign in to comment.
Something went wrong with that request. Please try again.