Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:jquery/jquery

  • Loading branch information
jeresig committed Nov 30, 2009
2 parents 90ba57c + 17955ca commit df6e02a4a7d8da037ebdb812e6b92a067223a6ea
Showing with 12 additions and 1 deletion.
  1. +1 −1 src/core.js
  2. +11 −0 test/unit/core.js
@@ -29,7 +29,7 @@ var jQuery = function( selector, context ) {
rnotwhite = /\S/,

// Used for trimming whitespace
rtrim = /^\s+|\s+$/g,
rtrim = /(\s|\u00A0)+|(\s|\u00A0)+$/g,

// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
@@ -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);

0 comments on commit df6e02a

Please sign in to comment.
You can’t perform that action at this time.