3 test("Basic requirements", function() {
5 ok( Array.prototype.push, "Array.push()" );
6 ok( Function.prototype.apply, "Function.apply()" );
7 ok( document.getElementById, "getElementById" );
8 ok( document.getElementsByTagName, "getElementsByTagName" );
9 ok( RegExp, "RegExp" );
10 ok( jQuery, "jQuery" );
14 test("jQuery()", function() {
17 // Basic constructor's behavior
19 equals( jQuery().length, 1, "jQuery() === jQuery(document)" );
20 equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
21 equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
22 equals( jQuery("").length, 0, "jQuery('') === jQuery([])" );
24 var obj = jQuery("div")
25 equals( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" );
27 // can actually yield more than one, when iframes are included, the window is an array as well
28 equals( 1, jQuery(window).length, "Correct number of elements generated for jQuery(window)" );
31 var main = jQuery("#main");
32 isSet( jQuery("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
35 // disabled since this test was doing nothing. i tried to fix it but i'm not sure
36 // what the expected behavior should even be. FF returns "\n" for the text node
37 // make sure this is handled
38 var crlfContainer = jQuery('<p>\r\n</p>');
39 var x = crlfContainer.contents().get(0).nodeValue;
40 equals( x, what???, "Check for \\r and \\n in jQuery()" );
43 /* // Disabled until we add this functionality in
46 jQuery("<div>Testing</div>").appendTo(document.getElementById("iframe").contentDocument.body);
50 ok( pass, "jQuery('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );*/
52 var code = jQuery("<code/>");
53 equals( code.length, 1, "Correct number of elements generated for code" );
54 var img = jQuery("<img/>");
55 equals( img.length, 1, "Correct number of elements generated for img" );
56 var div = jQuery("<div/><hr/><code/><b/>");
57 equals( div.length, 4, "Correct number of elements generated for div hr code b" );
59 equals( jQuery([1,2,3]).get(1), 2, "Test passing an array to the factory" );
61 equals( jQuery(document.body).get(0), jQuery('body').get(0), "Test passing an html node to the factory" );
64 test("selector state", function() {
69 test = jQuery(undefined);
70 equals( test.selector, "", "Empty jQuery Selector" );
71 equals( test.context, undefined, "Empty jQuery Context" );
73 test = jQuery(document);
74 equals( test.selector, "", "Document Selector" );
75 equals( test.context, document, "Document Context" );
77 test = jQuery(document.body);
78 equals( test.selector, "", "Body Selector" );
79 equals( test.context, document.body, "Body Context" );
81 test = jQuery("#main");
82 equals( test.selector, "#main", "#main Selector" );
83 equals( test.context, document, "#main Context" );
85 test = jQuery("#notfoundnono");
86 equals( test.selector, "#notfoundnono", "#notfoundnono Selector" );
87 equals( test.context, document, "#notfoundnono Context" );
89 test = jQuery("#main", document);
90 equals( test.selector, "#main", "#main Selector" );
91 equals( test.context, document, "#main Context" );
93 test = jQuery("#main", document.body);
94 equals( test.selector, "#main", "#main Selector" );
95 equals( test.context, document.body, "#main Context" );
99 equals( test.selector, "#main", "#main Selector" );
100 equals( test.context, document.body, "#main Context" );
102 test = jQuery(document.body).find("#main");
103 equals( test.selector, "#main", "#main find Selector" );
104 equals( test.context, document.body, "#main find Context" );
106 test = jQuery("#main").filter("div");
107 equals( test.selector, "#main.filter(div)", "#main filter Selector" );
108 equals( test.context, document, "#main filter Context" );
110 test = jQuery("#main").not("div");
111 equals( test.selector, "#main.not(div)", "#main not Selector" );
112 equals( test.context, document, "#main not Context" );
114 test = jQuery("#main").filter("div").not("div");
115 equals( test.selector, "#main.filter(div).not(div)", "#main filter, not Selector" );
116 equals( test.context, document, "#main filter, not Context" );
118 test = jQuery("#main").filter("div").not("div").end();
119 equals( test.selector, "#main.filter(div)", "#main filter, not, end Selector" );
120 equals( test.context, document, "#main filter, not, end Context" );
122 test = jQuery("#main").parent("body");
123 equals( test.selector, "#main.parent(body)", "#main parent Selector" );
124 equals( test.context, document, "#main parent Context" );
126 test = jQuery("#main").eq(0);
127 equals( test.selector, "#main.slice(0,1)", "#main eq Selector" );
128 equals( test.context, document, "#main eq Context" );
131 test("browser", function() {
135 "Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)": "6.0",
136 "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)": "7.0",
138 * "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)": "7.0",
140 //Browsers with Gecko engine
142 "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915" : "1.7.12",
144 "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3": "1.8.1.3",
146 "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20070321 Netscape/8.1.3" : "1.7.5",
148 "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070321 Firefox/1.5.0.11 Flock/0.7.12" : "1.8.0.11",
150 "Opera/9.20 (X11; Linux x86_64; U; en)": "9.20",
151 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.20" : "9.20",
152 "Mozilla/5.0 (Windows NT 5.1; U; pl; rv:1.8.0) Gecko/20060728 Firefox/1.5.0 Opera 9.20": "9.20",
154 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3": "418.9",
155 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3" : "418.8",
156 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/312.8 (KHTML, like Gecko) Safari/312.5": "312.8",
157 //Other user agent string
158 "Other browser's user agent 1.0":null
160 for (var i in browsers) {
161 var v = i.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ); // RegEx from Core jQuery.browser.version check
162 var version = v ? v[1] : null;
163 equals( version, browsers[i], "Checking UA string" );
167 test("noConflict", function() {
172 equals( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
173 equals( jQuery, $$, "Make sure jQuery wasn't touched." );
174 equals( $, original$, "Make sure $ was reverted." );
178 equals( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
179 equals( jQuery, originaljQuery, "Make sure jQuery was reverted." );
180 equals( $, original$, "Make sure $ was reverted." );
185 test("isFunction", function() {
188 // Make sure that false values return false
189 ok( !jQuery.isFunction(), "No Value" );
190 ok( !jQuery.isFunction( null ), "null Value" );
191 ok( !jQuery.isFunction( undefined ), "undefined Value" );
192 ok( !jQuery.isFunction( "" ), "Empty String Value" );
193 ok( !jQuery.isFunction( 0 ), "0 Value" );
196 // Safari uses "(Internal Function)"
197 ok( jQuery.isFunction(String), "String Function("+String+")" );
198 ok( jQuery.isFunction(Array), "Array Function("+Array+")" );
199 ok( jQuery.isFunction(Object), "Object Function("+Object+")" );
200 ok( jQuery.isFunction(Function), "Function Function("+Function+")" );
202 // When stringified, this could be misinterpreted
203 var mystr = "function";
204 ok( !jQuery.isFunction(mystr), "Function String" );
206 // When stringified, this could be misinterpreted
207 var myarr = [ "function" ];
208 ok( !jQuery.isFunction(myarr), "Function Array" );
210 // When stringified, this could be misinterpreted
211 var myfunction = { "function": "test" };
212 ok( !jQuery.isFunction(myfunction), "Function Object" );
214 // Make sure normal functions still work
215 var fn = function(){};
216 ok( jQuery.isFunction(fn), "Normal Function" );
218 var obj = document.createElement("object");
220 // Firefox says this is a function
221 ok( !jQuery.isFunction(obj), "Object Element" );
223 // IE says this is an object
224 // Since 1.3, this isn't supported (#2968)
225 //ok( jQuery.isFunction(obj.getAttribute), "getAttribute Function" );
227 var nodes = document.body.childNodes;
229 // Safari says this is a function
230 ok( !jQuery.isFunction(nodes), "childNodes Property" );
232 var first = document.body.firstChild;
234 // Normal elements are reported ok everywhere
235 ok( !jQuery.isFunction(first), "A normal DOM Element" );
237 var input = document.createElement("input");
239 document.body.appendChild( input );
241 // IE says this is an object
242 // Since 1.3, this isn't supported (#2968)
243 //ok( jQuery.isFunction(input.focus), "A default function property" );
245 document.body.removeChild( input );
247 var a = document.createElement("a");
248 a.href = "some-function";
249 document.body.appendChild( a );
251 // This serializes with the word 'function' in it
252 ok( !jQuery.isFunction(a), "Anchor Element" );
254 document.body.removeChild( a );
256 // Recursive function calls have lengths and array-like properties
257 function callme(callback){
258 function fn(response){
262 ok( jQuery.isFunction(fn), "Recursive Function Call" );
264 fn({ some: "data" });
268 callme(function(){});
272 test("jQuery('html')", function() {
277 var s = jQuery("<script>jQuery.foo='test';</script>")[0];
278 ok( s, "Creating a script" );
279 ok( !jQuery.foo, "Make sure the script wasn't executed prematurely" );
280 jQuery("body").append("<script>jQuery.foo='test';</script>");
281 ok( jQuery.foo, "Executing a scripts contents in the right context" );
284 ok( jQuery("<link rel='stylesheet'/>")[0], "Creating a link" );
286 ok( !jQuery("<script/>")[0].parentNode, "Create a script" );
288 ok( jQuery("<input/>").attr("type", "hidden"), "Create an input and set the type." );
290 var j = jQuery("<span>hi</span> there <!-- mon ami -->");
291 ok( j.length >= 2, "Check node,textnode,comment creation (some browsers delete comments)" );
293 ok( !jQuery("<option>test</option>")[0].selected, "Make sure that options are auto-selected #2050" );
296 test("jQuery('html', context)", function() {
299 var $div = jQuery("<div/>");
300 var $span = jQuery("<span/>", $div);
301 equals($span.length, 1, "Verify a span created with a div context works, #1763");
305 test("jQuery(selector, xml).text(str) - Loaded via XML document", function() {
308 jQuery.get('data/dashboard.xml', function(xml) {
309 // tests for #1419 where IE was a problem
310 var tab = jQuery("tab", xml).eq(0);
311 equals( tab.text(), "blabla", "Verify initial text correct" );
313 equals( tab.text(), "newtext", "Verify new text correct" );
319 test("length", function() {
321 equals( jQuery("p").length, 6, "Get Number of Elements Found" );
324 test("size()", function() {
326 equals( jQuery("p").size(), 6, "Get Number of Elements Found" );
329 test("get()", function() {
331 isSet( jQuery("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
334 test("toArray()", function() {
336 isSet ( jQuery("p").toArray(),
337 q("firstp","ap","sndp","en","sap","first"),
338 "Convert jQuery object to an Array" )
341 test("get(Number)", function() {
343 equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
346 test("get(-Number)",function() {
348 equals( jQuery("p").get(-1),
349 document.getElementById("first"),
350 "Get a single element with negative index" )
353 test("add(String|Element|Array|undefined)", function() {
355 isSet( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
356 isSet( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
357 ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" );
359 // For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE
360 // use jQuery([]).add(form.elements) instead.
361 //equals( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" );
363 var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>")).add(jQuery("<p id='x2'>xxx</p>"));
364 equals( x[0].id, "x1", "Check on-the-fly element1" );
365 equals( x[1].id, "x2", "Check on-the-fly element2" );
367 var x = jQuery([]).add("<p id='x1'>xxx</p>").add("<p id='x2'>xxx</p>");
368 equals( x[0].id, "x1", "Check on-the-fly element1" );
369 equals( x[1].id, "x2", "Check on-the-fly element2" );
372 equals( jQuery([]).add(notDefined).length, 0, "Check that undefined adds nothing" );
375 equals( jQuery([]).add([window,document,document.body,document]).length, 3, "Pass an array" );
376 equals( jQuery(document).add(document).length, 1, "Check duplicated elements" );
377 equals( jQuery(window).add(window).length, 1, "Check duplicated elements using the window" );
378 ok( jQuery([]).add( document.getElementById('form') ).length >= 13, "Add a form (adds the elements)" );
381 test("each(Function)", function() {
383 var div = jQuery("div");
384 div.each(function(){this.foo = 'zoo';});
386 for ( var i = 0; i < div.size(); i++ ) {
387 if ( div.get(i).foo != "zoo" ) pass = false;
389 ok( pass, "Execute a function, Relative" );
392 test("index()", function() {
395 equals( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" )
398 test("index(Object|String|undefined)", function() {
401 var elements = jQuery([window, document]),
402 inputElements = jQuery('#radio1,#radio2,#check1,#check2');
405 equals( elements.index(window), 0, "Check for index of elements" );
406 equals( elements.index(document), 1, "Check for index of elements" );
407 equals( inputElements.index(document.getElementById('radio1')), 0, "Check for index of elements" );
408 equals( inputElements.index(document.getElementById('radio2')), 1, "Check for index of elements" );
409 equals( inputElements.index(document.getElementById('check1')), 2, "Check for index of elements" );
410 equals( inputElements.index(document.getElementById('check2')), 3, "Check for index of elements" );
411 equals( inputElements.index(window), -1, "Check for not found index" );
412 equals( inputElements.index(document), -1, "Check for not found index" );
414 // Passing a jQuery object
415 // enabled since [5500]
416 equals( elements.index( elements ), 0, "Pass in a jQuery object" );
417 equals( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" );
418 equals( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Pass in a jQuery object" );
420 // Passing a selector or nothing
421 // enabled since [6330]
422 equals( jQuery('#text2').index(), 2, "Check for index amongst siblings" );
423 equals( jQuery('#form').children().eq(4).index(), 4, "Check for index amongst siblings" );
424 equals( jQuery('#radio2').index('#form :radio') , 1, "Check for index within a selector" );
425 equals( jQuery('#form :radio').index( jQuery('#radio2') ), 1, "Check for index within a selector" );
426 equals( jQuery('#radio2').index('#form :text') , -1, "Check for index not found within a selector" );
429 test("jQuery.merge()", function() {
432 var parse = jQuery.merge;
434 same( parse([],[]), [], "Empty arrays" );
436 same( parse([1],[2]), [1,2], "Basic" );
437 same( parse([1,2],[3,4]), [1,2,3,4], "Basic" );
439 same( parse([1,2],[]), [1,2], "Second empty" );
440 same( parse([],[1,2]), [1,2], "First empty" );
442 // Fixed at [5998], #3641
443 same( parse([-2,-1], [0,1,2]), [-2,-1,0,1,2], "Second array including a zero (falsy)");
446 test("jQuery.extend(Object, Object)", function() {
449 var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
450 options = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
451 optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
452 merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" },
453 deep1 = { foo: { bar: true } },
454 deep1copy = { foo: { bar: true } },
455 deep2 = { foo: { baz: true }, foo2: document },
456 deep2copy = { foo: { baz: true }, foo2: document },
457 deepmerged = { foo: { bar: true, baz: true }, foo2: document };
459 jQuery.extend(settings, options);
460 isObj( settings, merged, "Check if extended: settings must be extended" );
461 isObj( options, optionsCopy, "Check if not modified: options must not be modified" );
463 jQuery.extend(settings, null, options);
464 isObj( settings, merged, "Check if extended: settings must be extended" );
465 isObj( options, optionsCopy, "Check if not modified: options must not be modified" );
467 jQuery.extend(true, deep1, deep2);
468 isObj( deep1.foo, deepmerged.foo, "Check if foo: settings must be extended" );
469 isObj( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" );
470 equals( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" );
473 var optionsWithLength = { foo: { length: -1 } };
474 jQuery.extend(true, empty, optionsWithLength);
475 isObj( empty.foo, optionsWithLength.foo, "The length property must copy correctly" );
478 var optionsWithDate = { foo: { date: new Date } };
479 jQuery.extend(true, empty, optionsWithDate);
480 isObj( empty.foo, optionsWithDate.foo, "Dates copy correctly" );
482 var myKlass = function() {};
484 var optionsWithCustomObject = { foo: { date: new myKlass } };
485 jQuery.extend(true, empty, optionsWithCustomObject);
486 isObj( empty.foo, optionsWithCustomObject.foo, "Custom objects copy correctly" );
489 nullUndef = jQuery.extend({}, options, { xnumber2: null });
490 ok( nullUndef.xnumber2 === null, "Check to make sure null values are copied");
492 nullUndef = jQuery.extend({}, options, { xnumber2: undefined });
493 ok( nullUndef.xnumber2 === options.xnumber2, "Check to make sure undefined values are not copied");
495 nullUndef = jQuery.extend({}, options, { xnumber0: null });
496 ok( nullUndef.xnumber0 === null, "Check to make sure null values are inserted");
499 var recursive = { foo:target, bar:5 };
500 jQuery.extend(true, target, recursive);
501 isObj( target, { bar:5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" );
503 var ret = jQuery.extend(true, { foo: [] }, { foo: [0] } ); // 1907
504 equals( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" );
506 var ret = jQuery.extend(true, { foo: "1,2,3" }, { foo: [1, 2, 3] } );
507 ok( typeof ret.foo != "string", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" );
509 var ret = jQuery.extend(true, { foo:"bar" }, { foo:null } );
510 ok( typeof ret.foo !== 'undefined', "Make sure a null value doesn't crash with deep extend, for #1908" );
512 var obj = { foo:null };
513 jQuery.extend(true, obj, { foo:"notnull" } );
514 equals( obj.foo, "notnull", "Make sure a null value can be overwritten" );
517 jQuery.extend(func, { key: "value" } );
518 equals( func.key, "value", "Verify a function can be extended" );
520 var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
521 defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
522 options1 = { xnumber2: 1, xstring2: "x" },
523 options1Copy = { xnumber2: 1, xstring2: "x" },
524 options2 = { xstring2: "xx", xxx: "newstringx" },
525 options2Copy = { xstring2: "xx", xxx: "newstringx" },
526 merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" };
528 var settings = jQuery.extend({}, defaults, options1, options2);
529 isObj( settings, merged2, "Check if extended: settings must be extended" );
530 isObj( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" );
531 isObj( options1, options1Copy, "Check if not modified: options1 must not be modified" );
532 isObj( options2, options2Copy, "Check if not modified: options2 must not be modified" );
535 test("jQuery.each(Object,Function)", function() {
537 jQuery.each( [0,1,2], function(i, n){
538 equals( i, n, "Check array iteration" );
541 jQuery.each( [5,6,7], function(i, n){
542 equals( i, n - 5, "Check array iteration" );
545 jQuery.each( { name: "name", lang: "lang" }, function(i, n){
546 equals( i, n, "Check object iteration" );
550 jQuery.each([1,2,3], function(i,v){ total += v; });
551 equals( total, 6, "Looping over an array" );
553 jQuery.each([1,2,3], function(i,v){ total += v; if ( i == 1 ) return false; });
554 equals( total, 3, "Looping over an array, with break" );
556 jQuery.each({"a":1,"b":2,"c":3}, function(i,v){ total += v; });
557 equals( total, 6, "Looping over an object" );
559 jQuery.each({"a":3,"b":3,"c":3}, function(i,v){ total += v; return false; });
560 equals( total, 3, "Looping over an object, with break" );
562 var f = function(){};
564 jQuery.each(f, function(i){
567 equals( "baz", f.foo, "Loop over a function" );
570 test("jQuery.makeArray", function(){
573 equals( jQuery.makeArray(jQuery('html>*'))[0].nodeName.toUpperCase(), "HEAD", "Pass makeArray a jQuery object" );
575 equals( jQuery.makeArray(document.getElementsByName("PWD")).slice(0,1)[0].name, "PWD", "Pass makeArray a nodelist" );
577 equals( (function(){ return jQuery.makeArray(arguments); })(1,2).join(""), "12", "Pass makeArray an arguments array" );
579 equals( jQuery.makeArray([1,2,3]).join(""), "123", "Pass makeArray a real array" );
581 equals( jQuery.makeArray().length, 0, "Pass nothing to makeArray and expect an empty array" );
583 equals( jQuery.makeArray( 0 )[0], 0 , "Pass makeArray a number" );
585 equals( jQuery.makeArray( "foo" )[0], "foo", "Pass makeArray a string" );
587 equals( jQuery.makeArray( true )[0].constructor, Boolean, "Pass makeArray a boolean" );
589 equals( jQuery.makeArray( document.createElement("div") )[0].nodeName.toUpperCase(), "DIV", "Pass makeArray a single node" );
591 equals( jQuery.makeArray( {length:2, 0:"a", 1:"b"} ).join(""), "ab", "Pass makeArray an array like map (with length)" );
593 ok( !!jQuery.makeArray( document.documentElement.childNodes ).slice(0,1)[0].nodeName, "Pass makeArray a childNodes array" );
595 // function, is tricky as it has length
596 equals( jQuery.makeArray( function(){ return 1;} )[0](), 1, "Pass makeArray a function" );
598 //window, also has length
599 equals( jQuery.makeArray(window)[0], window, "Pass makeArray the window" );
601 equals( jQuery.makeArray(/a/)[0].constructor, RegExp, "Pass makeArray a regex" );
603 ok( jQuery.makeArray(document.getElementById('form')).length >= 13, "Pass makeArray a form (treat as elements)" );
606 test("jQuery.isEmptyObject", function(){
609 equals(true, jQuery.isEmptyObject({}), "isEmptyObject on empty object literal" );
610 equals(false, jQuery.isEmptyObject({a:1}), "isEmptyObject on non-empty object literal" );
613 // equals(true, jQuery.isEmptyObject(null), "isEmptyObject on null" );