MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / testSubstitute

Function testSubstitute

lib/web/CodeMirror/test/vim_test.js:4194–4209  ·  view source on GitHub ↗
(name, options)

Source from the content-addressed store, hash-verified

4192
4193// More complex substitute tests that test both pcre and nopcre options.
4194function 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}
4210testSubstitute('ex_substitute_capture', {
4211 value: 'a11 a12 a13',
4212 expectedValue: 'a1111 a1212 a1313',

Callers 1

vim_test.jsFile · 0.85

Calls 4

testVimFunction · 0.85
eqFunction · 0.85
setOptionMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected