forked from jquery/sizzle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bringing some test suite changes back from jQuery.
- Loading branch information
Showing
7 changed files
with
85 additions
and
955 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "test/qunit"] | ||
path = test/qunit | ||
url = git://github.com/jquery/qunit.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var jQuery = this.jQuery || "jQuery", // For testing .noConflict() | ||
$ = this.$ || "$", | ||
originaljQuery = jQuery, | ||
original$ = $; | ||
|
||
/** | ||
* Returns an array of elements with the given IDs, eg. | ||
* @example q("main", "foo", "bar") | ||
* @result [<div id="main">, <span id="foo">, <input id="bar">] | ||
*/ | ||
function q() { | ||
var r = []; | ||
|
||
for ( var i = 0; 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"]); | ||
* @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baa | ||
r' | ||
*/ | ||
function t(a,b,c) { | ||
var f = jQuery(b).get(), s = ""; | ||
|
||
for ( var i = 0; i < f.length; i++ ) { | ||
s += (s && ",") + '"' + f[i].id + '"'; | ||
} | ||
|
||
same(f, q.apply(q,c), a + " (" + b + ")"); | ||
} | ||
|
||
/** | ||
* Add random number to url to stop IE from caching | ||
* | ||
* @example url("data/test.html") | ||
* @result "data/test.html?10538358428943" | ||
* | ||
* @example url("data/test.php?foo=bar") | ||
* @result "data/test.php?foo=bar&10538358345554" | ||
*/ | ||
function url(value) { | ||
return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule qunit
added at
958c03
Oops, something went wrong.