aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJordan Boesch <jboesch26@gmail.com>2011-02-27 12:47:35 -0600
committerJordan Boesch <jboesch26@gmail.com>2011-02-27 12:47:35 -0600
commitc8a887af066a62840ec1910604ddb7e0c38728e8 (patch)
tree238347fdbae602a5f0cf6c603905bf71d01776c3 /test
parent71bd828d9f975fb1047b9fa2a78949cafd8006ac (diff)
downloadjquery-c8a887af066a62840ec1910604ddb7e0c38728e8.tar.gz
jquery-c8a887af066a62840ec1910604ddb7e0c38728e8.zip
Bug 2616; Adding object support to jQuery.map
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index bce0de0f0..d77e6a976 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -608,7 +608,7 @@ test("first()/last()", function() {
});
test("map()", function() {
- expect(2);//expect(6);
+ expect(6);
same(
jQuery("#ap").map(function(){
@@ -625,26 +625,24 @@ test("map()", function() {
q("ap","ap","ap"),
"Single Map"
);
-
- return;//these haven't been accepted yet
-
+
//for #2616
var keys = jQuery.map( {a:1,b:2}, function( v, k ){
return k;
- }, [ ] );
+ });
equals( keys.join(""), "ab", "Map the keys from a hash to an array" );
var values = jQuery.map( {a:1,b:2}, function( v, k ){
return v;
- }, [ ] );
+ });
equals( values.join(""), "12", "Map the values from a hash to an array" );
var scripts = document.getElementsByTagName("script");
var mapped = jQuery.map( scripts, function( v, k ){
return v;
- }, {length:0} );
+ });
equals( mapped.length, scripts.length, "Map an array(-like) to a hash" );