aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-11-30 10:21:56 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-11-30 10:22:18 -0800
commit17955cacf4e8c618ca5c2b09b0d2f43df353f683 (patch)
treef2772bfdc093dd2fde15b5fa943641cea2f0ed41 /test
parent84857abefce7b5ec4f4018caf98d7d61e952789f (diff)
downloadjquery-17955cacf4e8c618ca5c2b09b0d2f43df353f683.tar.gz
jquery-17955cacf4e8c618ca5c2b09b0d2f43df353f683.zip
Fixes $.trim for &nbsp; closes #4980
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js11
1 files changed, 11 insertions, 0 deletions
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", "&nbsp;" );
+});
+
test("isFunction", function() {
expect(19);