X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=590bb0c869f70e56e50bdee098d0b2564916d344;hb=3b221da8b03265543f335f6160b945bfe55f8d9e;hp=d8aba16db0d856efb8a39950fac358161000f976;hpb=94d925cd4615d88532737f3cd106ecd1f8c34bc3;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index d8aba16..590bb0c 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -201,14 +201,20 @@ test("noConflict", function() { }); test("trim", function() { - expect(4); + expect(9); - var nbsp = String.fromCharCode(160); + var nbsp = String.fromCharCode(160); - equals( jQuery.trim("hello "), "hello", "trailing space" ); - equals( jQuery.trim(" hello"), "hello", "leading space" ); - equals( jQuery.trim(" hello "), "hello", "space on both sides" ); - equals( jQuery.trim(" " + nbsp + "hello " + nbsp + " "), "hello", " " ); + equals( jQuery.trim("hello "), "hello", "trailing space" ); + equals( jQuery.trim(" hello"), "hello", "leading space" ); + equals( jQuery.trim(" hello "), "hello", "space on both sides" ); + equals( jQuery.trim(" " + nbsp + "hello " + nbsp + " "), "hello", " " ); + + equals( jQuery.trim(), "", "Nothing in." ); + equals( jQuery.trim( undefined ), "", "Undefined" ); + equals( jQuery.trim( null ), "", "Null" ); + equals( jQuery.trim( 5 ), "5", "Number" ); + equals( jQuery.trim( false ), "false", "Boolean" ); }); test("isPlainObject", function() { @@ -265,7 +271,7 @@ test("isPlainObject", function() { var doc = iframe.contentDocument || iframe.contentWindow.document; doc.open(); - doc.write(""); + doc.write(""); doc.close(); });