From 17955cacf4e8c618ca5c2b09b0d2f43df353f683 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Mon, 30 Nov 2009 10:21:56 -0800 Subject: Fixes $.trim for   closes #4980 --- test/unit/core.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/unit/core.js b/test/unit/core.js index 4044bd856..0640cf5ce 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); -- cgit v1.2.3