lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js in gollum-3.1.2 vs lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js in gollum-3.1.3
- old
+ new
@@ -74,9 +74,33 @@
assert.equal(session.getFoldWidget(1), "");
assert.equal(session.getFoldWidget(2), "end");
assert.range(session.getFoldWidgetRange(0), 0, 2, 2, 7);
assert.range(session.getFoldWidgetRange(2), 0, 2, 2, 7);
+ },
+
+ "test: fold sections": function() {
+ var session = new EditSession([
+ '/* section0 */',
+ '{',
+ ' /* section1 */',
+ ' stuff',
+ ' ',
+ ' /* section2 */',
+ ' ',
+ ' stuff',
+ ' ',
+ ' }',
+ 'foo'
+ ]);
+
+ var mode = new JavaScriptMode();
+ session.setFoldStyle("markbegin");
+ session.setMode(mode);
+
+ assert.range(session.getFoldWidgetRange(0, true), 0, 14, 10, 3);
+ assert.range(session.getFoldWidgetRange(2, true), 2, 18, 3, 9);
+ assert.range(session.getFoldWidgetRange(5, true), 5, 18, 7, 9);
}
};
});