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

Function testSelection

lib/web/CodeMirror/test/vim_test.js:1453–1464  ·  view source on GitHub ↗
(name, before, pos, keys, sel)

Source from the content-addressed store, hash-verified

1451});
1452
1453function testSelection(name, before, pos, keys, sel) {
1454 return testVim(name, function(cm, vim, helpers) {
1455 var ch = before.search(pos)
1456 var line = before.substring(0, ch).split('\n').length - 1;
1457 if (line) {
1458 ch = before.substring(0, ch).split('\n').pop().length;
1459 }
1460 cm.setCursor(line, ch);
1461 helpers.doKeys.apply(this, keys.split(''));
1462 eq(sel, cm.getSelection());
1463 }, {value: before});
1464}
1465testSelection('viw_middle_spc', 'foo \tbAr\t baz', /A/, 'viw', 'bAr');
1466testSelection('vaw_middle_spc', 'foo \tbAr\t baz', /A/, 'vaw', 'bAr\t ');
1467testSelection('viw_middle_punct', 'foo \tbAr,\t baz', /A/, 'viw', 'bAr');

Callers 1

vim_test.jsFile · 0.85

Calls 7

testVimFunction · 0.85
eqFunction · 0.85
getSelectionMethod · 0.80
applyMethod · 0.65
searchMethod · 0.45
splitMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected