Skip to content
Permalink
Browse files

Unit test for this case

Codestyle fixes
  • Loading branch information...
anton-ryzhov committed Aug 17, 2011
1 parent 9c18eb2 commit 190136cf6132620327a86274fb108fabf55a1d4f
Showing with 11 additions and 2 deletions.
  1. +1 −2 src/core.js
  2. +10 −0 test/unit/core.js
@@ -678,8 +678,7 @@ jQuery.extend({
},

inArray: function( elem, array ) {
if (!jQuery.isArray(array))
{
if ( !array ) {
return -1;
}

@@ -916,6 +916,16 @@ test("jQuery.makeArray", function(){
same( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly.");
});

test("jQuery.inArray", function(){
expect(3);

equals( jQuery.inArray( 0, false ), -1 , "Search in 'false' as array returns -1 and doesn't throw exception" );

equals( jQuery.inArray( 0, null ), -1 , "Search in 'null' as array returns -1 and doesn't throw exception" );

equals( jQuery.inArray( 0, undefined ), -1 , "Search in 'undefined' as array returns -1 and doesn't throw exception" );
});

test("jQuery.isEmptyObject", function(){
expect(2);

0 comments on commit 190136c

Please sign in to comment.
You can’t perform that action at this time.