MCPcopy
hub / github.com/ajaxorg/ace / testSubstitute

Function testSubstitute

src/keyboard/vim_test.js:4606–4621  ·  view source on GitHub ↗
(name, options)

Source from the content-addressed store, hash-verified

4604
4605// More complex substitute tests that test both pcre and nopcre options.
4606function testSubstitute(name, options) {
4607 testVim(name + '_pcre', function(cm, vim, helpers) {
4608 cm.setCursor(1, 0);
4609 CodeMirror.Vim.setOption('pcre', true);
4610 helpers.doEx(options.expr);
4611 eq(options.expectedValue, cm.getValue());
4612 }, options);
4613 // If no noPcreExpr is defined, assume that it's the same as the expr.
4614 var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr;
4615 testVim(name + '_nopcre', function(cm, vim, helpers) {
4616 cm.setCursor(1, 0);
4617 CodeMirror.Vim.setOption('pcre', false);
4618 helpers.doEx(noPcreExpr);
4619 eq(options.expectedValue, cm.getValue());
4620 }, options);
4621}
4622testSubstitute('ex_substitute_capture', {
4623 value: 'a11 a12 a13',
4624 expectedValue: 'a1111 a1212 a1313',

Callers 1

vim_test.jsFile · 0.85

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…