aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorAriel Flesler <aflesler@gmail.com>2008-12-25 19:25:30 +0000
committerAriel Flesler <aflesler@gmail.com>2008-12-25 19:25:30 +0000
commit4b25b147ab60a026ba1841b313d713fe57530b04 (patch)
tree63cf9b54b057e761b6dcbdc0ba73d1e7a3f8ee1c /test/unit
parent5459180728260b09a5d1d8b8ea17201dda131d47 (diff)
downloadjquery-4b25b147ab60a026ba1841b313d713fe57530b04.tar.gz
jquery-4b25b147ab60a026ba1841b313d713fe57530b04.zip
jquery core: Closes #3641. jQuery.merge stopped looping once a 0 was found.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/core.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 1ae2dfa5f..679d50425 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -1138,6 +1138,21 @@ test("is(String)", function() {
ok( jQuery('#en').is('[lang="de"] , [lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
});
+test("jQuery.merge()", function() {
+ var parse = jQuery.merge;
+
+ same( parse([],[]), [], "Empty arrays" );
+
+ same( parse([1],[2]), [1,2], "Basic" );
+ same( parse([1,2],[3,4]), [1,2,3,4], "Basic" );
+
+ same( parse([1,2],[]), [1,2], "Second empty" );
+ same( parse([],[1,2]), [1,2], "First empty" );
+
+ // Fixed at [5998], #3641
+ same( parse([-2,-1], [0,1,2]), [-2,-1,0,1,2], "Second array including a zero (falsy)");
+});
+
test("jQuery.extend(Object, Object)", function() {
expect(20);