| | 153 | testSqueeze: function() {with(this) { |
|---|
| | 154 | assertEqual('a', 'a'.squeeze()); |
|---|
| | 155 | assertEqual('helo world!', 'hellllllooooo woooooooorrld!!!!'.squeeze()); |
|---|
| | 156 | assertEqual('hello world', 'hello world'.squeeze('')); |
|---|
| | 157 | assertEqual('hello world', 'hello world'.squeeze(' ')); |
|---|
| | 158 | assertEqual('hello \n world', 'hello \n world'.squeeze(' ')); |
|---|
| | 159 | assertEqual('hello world.', 'hello world...'.squeeze('.')); |
|---|
| | 160 | assertEqual('hello world', 'hello world'.squeeze('v')); |
|---|
| | 161 | assertEqual('helo world.', 'hellllllo world...'.squeeze('.l')); |
|---|
| | 162 | assertEqual('helo world.', 'hellllllo world...'.squeeze('l.v')); |
|---|
| | 163 | assertEqual('hello world...', 'hello worrrrrld...'.squeeze('q-z')); |
|---|
| | 164 | assertEqual('hello-world.', 'hello-------world...'.squeeze('.-')); |
|---|
| | 165 | assertEqual('hello\\', 'hello\\\\\\\\\\\\\\\\\\'.squeeze('\\')); |
|---|
| | 166 | assertEqual('hello^', 'hello^^^^^^^^^'.squeeze('^')); |
|---|
| | 167 | assertEqual('\t', '\t\t\t\t'.squeeze(' ')); |
|---|
| | 168 | assertEqual('', ''.squeeze()); |
|---|
| | 169 | }}, |
|---|
| | 170 | |
|---|
| | 171 | testStripLineBreaks: function() {with(this) { |
|---|
| | 172 | assertEqual('hello world', 'hello world'.stripLineBreaks()); |
|---|
| | 173 | assertEqual('hello world', 'hello\n world'.stripLineBreaks()); |
|---|
| | 174 | assertEqual('hello world', 'hello\r world'.stripLineBreaks()); |
|---|
| | 175 | assertEqual('hello world', 'hello\r\n world'.stripLineBreaks()); |
|---|
| | 176 | assertEqual('hello world', 'hello \r\n\r\n\r\r\n\r\n\r\n world'.stripLineBreaks()); |
|---|
| | 177 | }}, |
|---|
| | 178 | |
|---|