Skip to content

Commit

Permalink
exhaustive test of String#trim behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanLukes committed Jun 4, 2014
1 parent b3fed1a commit 820d4b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,15 @@ var runStringTests = function() {
});

it('#trim()', function() {
var trimmed = '\u0085'.trim();
var whitespace = '\u0009' + '\u000b' + '\u000c' + '\u0020'
+ '\u00a0' + '\u1680' + '\u2000' + '\u2001'
+ '\u2002' + '\u2003' + '\u2004' + '\u2005'
+ '\u2006' + '\u2007' + '\u2008' + '\u2009'
+ '\u200A' + '\u202f' + '\u205f' + '\u3000';

var lineTerminators = '\u000a' + '\u000d' + '\u2028' + '\u2029';

var trimmed = (whitespace + lineTerminators).trim();
expect(trimmed.length).to.equal(0);
expect(trimmed).to.equal('');
});
Expand Down

0 comments on commit 820d4b1

Please sign in to comment.