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

Function testEdit

lib/web/CodeMirror/test/vim_test.js:1322–1336  ·  view source on GitHub ↗
(name, before, pos, edit, after, configureCm)

Source from the content-addressed store, hash-verified

1320// Edit tests - configureCm is an optional argument that gives caller
1321// access to the cm object.
1322function testEdit(name, before, pos, edit, after, configureCm) {
1323 return testVim(name, function(cm, vim, helpers) {
1324 if (configureCm) {
1325 configureCm(cm);
1326 }
1327 var ch = before.search(pos)
1328 var line = before.substring(0, ch).split('\n').length - 1;
1329 if (line) {
1330 ch = before.substring(0, ch).split('\n').pop().length;
1331 }
1332 cm.setCursor(line, ch);
1333 helpers.doKeys.apply(this, edit.split(''));
1334 eq(after, cm.getValue());
1335 }, {value: before});
1336}
1337
1338// These Delete tests effectively cover word-wise Change, Visual & Yank.
1339// Tabs are used as differentiated whitespace to catch edge cases.

Callers 1

vim_test.jsFile · 0.85

Calls 7

testVimFunction · 0.85
eqFunction · 0.85
applyMethod · 0.65
searchMethod · 0.45
splitMethod · 0.45
popMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected