X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=0640cf5ce24052c6c1137c1d6d41999c1dff04b1;hb=17955cacf4e8c618ca5c2b09b0d2f43df353f683;hp=4044bd85683dca98d9cfddc005bdf505a94750b3;hpb=84857abefce7b5ec4f4018caf98d7d61e952789f;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 4044bd8..0640cf5 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -189,6 +189,17 @@ test("noConflict", function() { jQuery = $$; }); +test("trim", function() { + expect(4); + + 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", " " ); +}); + test("isFunction", function() { expect(19);