Clear some dangling whitespace
[jquery.git] / test / unit / core.js
index ac93dda..347864e 100644 (file)
@@ -15,16 +15,16 @@ test("jQuery()", function() {
        expect(11);
 
        // Basic constructor's behavior
-       
+
        equals( jQuery().length, 1, "jQuery() === jQuery(document)" );
        equals( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
        equals( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
        equals( jQuery("").length, 0, "jQuery('') === jQuery([])" );
-               
+
                // can actually yield more than one, when iframes are included, the window is an array as well
        equals( 1, jQuery(window).length, "Correct number of elements generated for jQuery(window)" );
-       
-       
+
+
        var main = jQuery("#main");
        isSet( jQuery("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
 
@@ -328,11 +328,25 @@ test("get()", function() {
        isSet( jQuery("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
 });
 
+test("toArray()", function() {
+       expect(1);
+       isSet ( jQuery("p").toArray(),
+               q("firstp","ap","sndp","en","sap","first"),
+               "Convert jQuery object to an Array" )
+})
+
 test("get(Number)", function() {
        expect(1);
        equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
 });
 
+test("get(-Number)",function() {
+       expect(1);
+       equals( jQuery("p").get(-1),
+               document.getElementById("first"),
+               "Get a single element with negative index" )
+})
+
 test("add(String|Element|Array|undefined)", function() {
        expect(12);
        isSet( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
@@ -519,7 +533,7 @@ test("jQuery.each(Object,Function)", function() {
        total = 0;
        jQuery.each({"a":3,"b":3,"c":3}, function(i,v){ total += v; return false; });
        equals( total, 3, "Looping over an object, with break" );
-       
+
        var f = function(){};
        f.foo = 'bar';
        jQuery.each(f, function(i){