File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 161161
162162 // handles multiple escape characters at once
163163 var joiner = ' other stuff ' ;
164- var allEscaped = escapeCharacters . join ( joiner ) ;
165- allEscaped += allEscaped ;
166- assert . ok ( _ . every ( escapeCharacters , function ( escapeChar ) {
167- return allEscaped . indexOf ( escapeChar ) !== - 1 ;
168- } ) , 'handles multiple characters' ) ;
169- assert . ok ( allEscaped . indexOf ( joiner ) >= 0 , 'can escape multiple escape characters at the same time' ) ;
164+ var allUnescaped = escapeCharacters . join ( joiner ) ;
165+ allUnescaped += allUnescaped ;
166+ var allEscaped = _ . escape ( allUnescaped ) ;
167+ assert . ok ( _ . every ( escapeCharacters ) , function ( escapeChar ) {
168+ return allEscaped . indexOf ( escapeChar ) === - 1 ;
169+ } , 'replaces all occurrences' ) ;
170+ assert . strictEqual ( _ . unescape ( allEscaped ) , allUnescaped , 'undos all replacements' ) ;
170171
171172 // test & -> &
172173 var str = 'some string & another string & yet another' ;
You can’t perform that action at this time.
0 commit comments