]> source.dussan.org Git - jquery.git/commitdiff
Minor test suite adjustments
authortimmywil <timmywillisn@gmail.com>
Mon, 28 May 2012 16:43:41 +0000 (12:43 -0400)
committertimmywil <timmywillisn@gmail.com>
Mon, 28 May 2012 16:43:41 +0000 (12:43 -0400)
test/data/testinit.js
test/unit/selector.js

index 9a27f5287f70a32c9cb333a1b8decb2d5c1a8748..85765b75c39663752bf9262f5e58eabe1820defd 100644 (file)
@@ -24,30 +24,34 @@ define.amd = {
  * @result [<div id="main">, <span id="foo">, <input id="bar">]
  */
 function q() {
-       var r = [];
+       var r = [],
+               i = 0;
 
-       for ( var i = 0; i < arguments.length; i++ ) {
+       for ( ; i < arguments.length; i++ ) {
                r.push( document.getElementById( arguments[i] ) );
        }
-
        return r;
 }
 
 /**
  * Asserts that a select matches the given IDs * @example t("Check for something", "//[a]", ["foo", "baar"]);
+ * @param {String} a - Assertion name
+ * @param {String} b - Sizzle selector
+ * @param {String} c - Array of ids to construct what is expected
  * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
  */
-function t(a,b,c) {
-       var f = jQuery(b).get(), s = "";
+function t( a, b, c ) {
+       var f = jQuery(b).get(),
+               s = "",
+               i = 0;
 
-       for ( var i = 0; i < f.length; i++ ) {
-               s += (s && ",") + '"' + f[i].id + '"';
+       for ( ; i < f.length; i++ ) {
+               s += ( s && "," ) + '"' + f[ i ].id + '"';
        }
 
-       deepEqual(f, q.apply(q,c), a + " (" + b + ")");
+       deepEqual(f, q.apply( q, c ), a + " (" + b + ")");
 }
 
-
 var createDashboardXML = function() {
        var string = '<?xml version="1.0" encoding="UTF-8"?> \
        <dashboard> \
index 18089c8c5845293ae2875cddd3e1adaf93827a61..d00dc153e9b1fe2ffb5d26c2e9f972d29b032daa 100644 (file)
@@ -75,7 +75,8 @@ testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQue
        }
 
        /**
-        * Asserts that a select matches the given IDs * @example t("Check for something", "//[a]", ["foo", "baar"]);
+        * Asserts that a select matches the given IDs
+        * @example t("Check for something", "//[a]", ["foo", "baar"]);
         * @param {String} a - Assertion name
         * @param {String} b - Sizzle selector
         * @param {String} c - Array of ids to construct what is expected