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

Function testCoordsWrappedBidi

lib/web/CodeMirror/test/test.js:2596–2617  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2594*/
2595
2596function testCoordsWrappedBidi(str) {
2597 testCM("coords_wrapped_bidi_" + str, function(cm) {
2598 cm.getScrollerElement().style.fontFamily = "monospace";
2599 makeItWrapAfter(cm, Pos(0, 5));
2600
2601 // Make sure we are at the visual beginning of the first line
2602 var pos = Pos(0, 0), lastPos;
2603 cm.doc.setCursor(pos);
2604 do {
2605 lastPos = pos;
2606 cm.execCommand("goCharLeft");
2607 pos = cm.doc.getCursor();
2608 } while (pos != lastPos)
2609
2610 var top = cm.charCoords(Pos(0, 0)).top, lastTop;
2611 for (var i = 1; i < str.length; ++i) {
2612 lastTop = top;
2613 top = cm.charCoords(Pos(0, i)).top;
2614 is(top >= lastTop);
2615 }
2616 }, {value: str, lineWrapping: true})
2617};
2618
2619testCoordsWrappedBidi("Count ١ ٢ ٣ ٤");
2620/*

Callers 1

test.jsFile · 0.85

Calls 4

testCMFunction · 0.85
makeItWrapAfterFunction · 0.85
isFunction · 0.70
PosFunction · 0.50

Tested by

no test coverage detected