From d9d930f79e9e4edb7339199cd758dc654e053a3b Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Mon, 4 May 2015 15:27:12 -0700 Subject: Selector: add jQuery.uniqueSort; deprecate jQuery.unique Fixes gh-2228 --- test/unit/selector.js | 6 +++--- test/unit/traversing.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test/unit') diff --git a/test/unit/selector.js b/test/unit/selector.js index 673a86f85..19b2c2210 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -385,7 +385,7 @@ test( "jQuery.contains", function() { ok( !jQuery.contains(document, detached), "document container (negative)" ); }); -test("jQuery.unique", function() { +test("jQuery.uniqueSort", function() { expect( 14 ); function Arrayish( arr ) { @@ -459,8 +459,8 @@ test("jQuery.unique", function() { jQuery.each( tests, function( label, test ) { var length = test.length || test.input.length; - deepEqual( jQuery.unique( test.input ).slice( 0, length ), test.expected, label + " (array)" ); - deepEqual( jQuery.unique( new Arrayish(test.input) ).slice( 0, length ), test.expected, label + " (quasi-array)" ); + deepEqual( jQuery.uniqueSort( test.input ).slice( 0, length ), test.expected, label + " (array)" ); + deepEqual( jQuery.uniqueSort( new Arrayish(test.input) ).slice( 0, length ), test.expected, label + " (quasi-array)" ); }); }); diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 1be1992cd..db58beec3 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -696,7 +696,7 @@ test("sort direction", function() { jQuery.each( methodDirections, function( method, reversed ) { var actual = elems[ method ]().get(), - forward = jQuery.unique( [].concat( actual ) ); + forward = jQuery.uniqueSort( [].concat( actual ) ); deepEqual( actual, reversed ? forward.reverse() : forward, "Correct sort direction for " + method ); }); }); -- cgit v1.2.3