X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=d8aba16db0d856efb8a39950fac358161000f976;hb=26b0e913dda386b6b2848196689a02a2da6aa40d;hp=54ad982d24f5d44d9bf244c2776d73eec33519c9;hpb=781fe8b80d08b287e4c6e4ca408f773c6a1f3b2d;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 54ad982..d8aba16 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -25,7 +25,7 @@ test("jQuery()", function() { equals( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" ); // 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)" ); + equals( jQuery(window).length, 1, "Correct number of elements generated for jQuery(window)" ); var main = jQuery("#main"); @@ -807,7 +807,7 @@ test("jQuery.proxy", function(){ }); test("jQuery.parseJSON", function(){ - expect(7); + expect(8); equals( jQuery.parseJSON(), null, "Nothing in, null out." ); equals( jQuery.parseJSON( null ), null, "Nothing in, null out." ); @@ -815,6 +815,8 @@ test("jQuery.parseJSON", function(){ same( jQuery.parseJSON("{}"), {}, "Plain object parsing." ); same( jQuery.parseJSON('{"test":1}'), {"test":1}, "Plain object parsing." ); + + same( jQuery.parseJSON('\n{"test":1}'), {"test":1}, "Make sure leading whitespaces are handled." ); try { jQuery.parseJSON("{a:1}"); @@ -829,4 +831,4 @@ test("jQuery.parseJSON", function(){ } catch( e ) { ok( true, "Test malformed JSON string." ); } -}); \ No newline at end of file +});