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

Function testMoveright

lib/web/CodeMirror/test/scroll_test.js:66–80  ·  view source on GitHub ↗
(cm, wrap, scroll)

Source from the content-addressed store, hash-verified

64 testCM("movedown_hscroll_resize", function(cm) {testMovedownResize(cm, true);});
65
66 function testMoveright(cm, wrap, scroll) {
67 cm.setSize("100px", "100px");
68 if (wrap) cm.setOption("lineWrapping", true);
69 if (scroll) {
70 cm.setValue("\n" + new Array(100).join("x\n"));
71 cm.setCursor(Pos(0, 0));
72 }
73 var right = displayRight(cm, scroll);
74 for (var i = 0; i < 10; i++) {
75 cm.replaceSelection("xxxxxxxxxx");
76 var cursorRight = cm.cursorCoords(null, "window").right;
77 is(cursorRight < right);
78 }
79 if (!wrap) is(cursorRight > right - 20);
80 }
81
82 testCM("moveright", function(cm) {testMoveright(cm, false, false);});
83 testCM("moveright_wrap", function(cm) {testMoveright(cm, true, false);});

Callers 1

scroll_test.jsFile · 0.85

Calls 5

displayRightFunction · 0.85
setOptionMethod · 0.80
isFunction · 0.70
PosFunction · 0.50
setValueMethod · 0.45

Tested by

no test coverage detected