(name, options)
| 4192 | |
| 4193 | // More complex substitute tests that test both pcre and nopcre options. |
| 4194 | function testSubstitute(name, options) { |
| 4195 | testVim(name + '_pcre', function(cm, vim, helpers) { |
| 4196 | cm.setCursor(1, 0); |
| 4197 | CodeMirror.Vim.setOption('pcre', true); |
| 4198 | helpers.doEx(options.expr); |
| 4199 | eq(options.expectedValue, cm.getValue()); |
| 4200 | }, options); |
| 4201 | // If no noPcreExpr is defined, assume that it's the same as the expr. |
| 4202 | var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr; |
| 4203 | testVim(name + '_nopcre', function(cm, vim, helpers) { |
| 4204 | cm.setCursor(1, 0); |
| 4205 | CodeMirror.Vim.setOption('pcre', false); |
| 4206 | helpers.doEx(noPcreExpr); |
| 4207 | eq(options.expectedValue, cm.getValue()); |
| 4208 | }, options); |
| 4209 | } |
| 4210 | testSubstitute('ex_substitute_capture', { |
| 4211 | value: 'a11 a12 a13', |
| 4212 | expectedValue: 'a1111 a1212 a1313', |
no test coverage detected