aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/core.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/core.js')
-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", " " );
+});
+
test("isFunction", function() {
expect(19);